diff options
Diffstat (limited to 'lib/Travel/Status/DE/HAFAS.pm')
| -rw-r--r-- | lib/Travel/Status/DE/HAFAS.pm | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Travel/Status/DE/HAFAS.pm b/lib/Travel/Status/DE/HAFAS.pm index fae1ed0..3cd9bef 100644 --- a/lib/Travel/Status/DE/HAFAS.pm +++ b/lib/Travel/Status/DE/HAFAS.pm @@ -23,7 +23,7 @@ use Travel::Status::DE::HAFAS::Product; use Travel::Status::DE::HAFAS::Services; use Travel::Status::DE::HAFAS::StopFinder; -our $VERSION = '6.20'; +our $VERSION = '6.24'; # {{{ Endpoint Definition @@ -41,6 +41,10 @@ sub new { my $ua = $conf{user_agent}; + if ( defined $service and not exists $hafas_instance->{$service} ) { + confess("The service '$service' is not supported"); + } + if ( not $ua ) { my %lwp_options = %{ $conf{lwp_options} // { timeout => 10 } }; if ( $service and $hafas_instance->{$service}{ua_string} ) { @@ -79,10 +83,6 @@ sub new { confess("You must specify a service"); } - if ( defined $service and not exists $hafas_instance->{$service} ) { - confess("The service '$service' is not supported"); - } - my $now = DateTime->now( time_zone => $hafas_instance->{$service}{time_zone} // 'Europe/Berlin' ); my $self = { @@ -805,7 +805,7 @@ sub station { for my $result ( $self->results ) { $eva_count{ $result->station_eva } += 1; $name_count{ $result->station } += 1; - $eva_by_name{ $result->station_eva } = $result->station; + $eva_by_name{ $result->station } = $result->station_eva; } my @most_frequent_evas = map { $_->[0] } sort { $b->[1] <=> $a->[1] } @@ -913,7 +913,7 @@ monitors =head1 VERSION -version 6.20 +version 6.24 =head1 DESCRIPTION |
