Loading bin/efa-m +8 −3 Original line number Diff line number Diff line Loading @@ -251,7 +251,7 @@ sub show_lines { for my $l ( $efa->lines ) { if ( ( @grep_lines and none { $l->name eq $_ } @grep_lines ) if ( ( @grep_lines and none { $l->number eq $_ } @grep_lines ) or ( @grep_mots and none { $l->mot_name eq $_ } @grep_mots ) ) { next; Loading @@ -261,8 +261,13 @@ sub show_lines { next; } push( @output, [ $l->type, $l->name, $l->direction // q{}, q{}, $l->route // q{} ] push( @output, [ $l->type, $l->number, $l->direction // q{}, q{}, $l->route // q{} ] ); } Loading lib/Travel/Status/DE/EFA.pm +5 −7 Original line number Diff line number Diff line Loading @@ -372,9 +372,11 @@ sub lines { return @{ $self->{lines} }; } for my $line ( @{ $self->{response}{servingLines} // [] } ) { for my $line ( @{ $self->{response}{servingLines}{lines} // [] } ) { push( @{ $self->{lines} }, $self->parse_line($line) ); } return @{ $self->{lines} // [] }; } sub parse_line { Loading @@ -383,7 +385,9 @@ sub parse_line { my $mode = $line->{mode} // {}; return Travel::Status::DE::EFA::Line->new( type => $mode->{product}, name => $mode->{name}, number => $mode->{number}, direction => $mode->{destination}, valid => $mode->{timetablePeriod}, mot => $mode->{product}, Loading Loading @@ -515,12 +519,6 @@ sub results { my $json = $self->{response}; if ( not @{ $self->{lines} // [] } ) { for my $line ( @{ $json->{servingLines}{lines} // [] } ) { push( @{ $self->{lines} }, $self->parse_line($line) ); } } for my $departure ( @{ $json->{departureList} // [] } ) { push( @results, $self->parse_departure($departure) ); } Loading lib/Travel/Status/DE/EFA/Line.pm +1 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ use parent 'Class::Accessor'; our $VERSION = '2.02'; Travel::Status::DE::EFA::Line->mk_ro_accessors( qw(direction mot name operator route type valid)); qw(direction mot name number operator route type valid)); my @mot_mapping = qw{ zug s-bahn u-bahn stadtbahn tram stadtbus regionalbus Loading Loading
bin/efa-m +8 −3 Original line number Diff line number Diff line Loading @@ -251,7 +251,7 @@ sub show_lines { for my $l ( $efa->lines ) { if ( ( @grep_lines and none { $l->name eq $_ } @grep_lines ) if ( ( @grep_lines and none { $l->number eq $_ } @grep_lines ) or ( @grep_mots and none { $l->mot_name eq $_ } @grep_mots ) ) { next; Loading @@ -261,8 +261,13 @@ sub show_lines { next; } push( @output, [ $l->type, $l->name, $l->direction // q{}, q{}, $l->route // q{} ] push( @output, [ $l->type, $l->number, $l->direction // q{}, q{}, $l->route // q{} ] ); } Loading
lib/Travel/Status/DE/EFA.pm +5 −7 Original line number Diff line number Diff line Loading @@ -372,9 +372,11 @@ sub lines { return @{ $self->{lines} }; } for my $line ( @{ $self->{response}{servingLines} // [] } ) { for my $line ( @{ $self->{response}{servingLines}{lines} // [] } ) { push( @{ $self->{lines} }, $self->parse_line($line) ); } return @{ $self->{lines} // [] }; } sub parse_line { Loading @@ -383,7 +385,9 @@ sub parse_line { my $mode = $line->{mode} // {}; return Travel::Status::DE::EFA::Line->new( type => $mode->{product}, name => $mode->{name}, number => $mode->{number}, direction => $mode->{destination}, valid => $mode->{timetablePeriod}, mot => $mode->{product}, Loading Loading @@ -515,12 +519,6 @@ sub results { my $json = $self->{response}; if ( not @{ $self->{lines} // [] } ) { for my $line ( @{ $json->{servingLines}{lines} // [] } ) { push( @{ $self->{lines} }, $self->parse_line($line) ); } } for my $departure ( @{ $json->{departureList} // [] } ) { push( @results, $self->parse_departure($departure) ); } Loading
lib/Travel/Status/DE/EFA/Line.pm +1 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ use parent 'Class::Accessor'; our $VERSION = '2.02'; Travel::Status::DE::EFA::Line->mk_ro_accessors( qw(direction mot name operator route type valid)); qw(direction mot name number operator route type valid)); my @mot_mapping = qw{ zug s-bahn u-bahn stadtbahn tram stadtbus regionalbus Loading