diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2023-11-19 12:24:29 +0100 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2023-11-19 12:24:29 +0100 |
commit | e89312355b7ca9f20c2ede319e76f1970e5c932e (patch) | |
tree | e9d98acd13d3c2fa7d9c7009c5d7b10185b58a9b /lib/Travel/Status/DE/HAFAS/Journey.pm | |
parent | f9678526018e4b31e25a3d8435a5ffd60e0ebe4d (diff) |
Move location-specific data and accessors to ...::HAFAS::Location
This is a breaking change that affects the accessors of ...::Stop and the
return type of $hafas->results in locationSearch and geoSearch mode
Diffstat (limited to 'lib/Travel/Status/DE/HAFAS/Journey.pm')
-rw-r--r-- | lib/Travel/Status/DE/HAFAS/Journey.pm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Travel/Status/DE/HAFAS/Journey.pm b/lib/Travel/Status/DE/HAFAS/Journey.pm index 37f8262..62e089a 100644 --- a/lib/Travel/Status/DE/HAFAS/Journey.pm +++ b/lib/Travel/Status/DE/HAFAS/Journey.pm @@ -26,7 +26,6 @@ Travel::Status::DE::HAFAS::Journey->mk_ro_accessors( sub new { my ( $obj, %opt ) = @_; - my @locL = @{ $opt{common}{locL} // [] }; my @prodL = @{ $opt{common}{prodL} // [] }; my @opL = @{ $opt{common}{opL} // [] }; my @icoL = @{ $opt{common}{icoL} // [] }; @@ -34,6 +33,7 @@ sub new { my @remL = @{ $opt{common}{remL} // [] }; my @himL = @{ $opt{common}{himL} // [] }; + my $locL = $opt{locL}; my $hafas = $opt{hafas}; my $journey = $opt{journey}; @@ -108,7 +108,7 @@ sub new { my @stops; my $route_end; for my $stop ( @{ $journey->{stopL} // [] } ) { - my $loc = $locL[ $stop->{locX} ]; + my $loc = $locL->[ $stop->{locX} ]; push( @stops, @@ -122,7 +122,7 @@ sub new { } ); - $route_end = $loc->{name}; + $route_end = $loc->name; } if ( $journey->{stbStop} ) { @@ -164,14 +164,14 @@ sub new { } } else { - $ref->{route_start} = $stops[0]{loc}{name}; + $ref->{route_start} = $stops[0]{loc}->name; } bless( $ref, $obj ); if ( $journey->{stbStop} ) { - $ref->{station} = $locL[ $journey->{stbStop}{locX} ]->{name}; - $ref->{station_eva} = 0 + $locL[ $journey->{stbStop}{locX} ]->{extId}; + $ref->{station} = $locL->[ $journey->{stbStop}{locX} ]->name; + $ref->{station_eva} = 0 + $locL->[ $journey->{stbStop}{locX} ]->eva; $ref->{sched_platform} = $journey->{stbStop}{dPlatfS}; $ref->{rt_platform} = $journey->{stbStop}{dPlatfR}; $ref->{platform} = $ref->{rt_platform} // $ref->{sched_platform}; |