From eca26bdf4b0082a852638997534a85d30d4187f2 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Sat, 4 Jan 2025 21:13:15 +0100 Subject: Consistently use id_num and id_code accessor names for stop IDs --- lib/Travel/Status/DE/EFA/Trip.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/Travel/Status/DE/EFA/Trip.pm') diff --git a/lib/Travel/Status/DE/EFA/Trip.pm b/lib/Travel/Status/DE/EFA/Trip.pm index a4fc9f0..d038e6a 100644 --- a/lib/Travel/Status/DE/EFA/Trip.pm +++ b/lib/Travel/Status/DE/EFA/Trip.pm @@ -49,6 +49,7 @@ sub polyline { my ( $self, %opt ) = @_; if ( $opt{fallback} and not @{ $self->{polyline} // [] } ) { + # TODO add $_->{id} as well? return map { $_->{latlon} } $self->route; } @@ -77,7 +78,7 @@ sub route { for my $stop ( @{ $self->{route_raw} // [] } ) { my $chain = $stop; - my ( $platform, $place, $name, $name_full, $stop_id ); + my ( $platform, $place, $name, $name_full, $id_num, $id_code ); while ( $chain->{type} ) { if ( $chain->{type} eq 'platform' ) { $platform = $chain->{properties}{platformName} @@ -86,7 +87,8 @@ sub route { elsif ( $chain->{type} eq 'stop' ) { $name = $chain->{disassembledName}; $name_full = $chain->{name}; - $stop_id = $chain->{properties}{stopId}; + $id_code = $chain->{id}; + $id_num = $chain->{properties}{stopId}; } elsif ( $chain->{type} eq 'locality' ) { $place = $chain->{name}; @@ -106,8 +108,8 @@ sub route { place => $place, niveau => $stop->{niveau}, platform => $platform, - id => $stop->{id}, - stop_id => $stop_id, + id_code => $id_code, + id_num => $id_num, ) ); } -- cgit v1.2.3