summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE/EFA/Trip.pm
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2025-01-04 21:13:15 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2025-01-04 21:13:15 +0100
commiteca26bdf4b0082a852638997534a85d30d4187f2 (patch)
tree37b79620cecb048c94e0c1f663a406427b4b6dde /lib/Travel/Status/DE/EFA/Trip.pm
parentc1d880d84e93d5c60098b2e3de909a950b78023c (diff)
Consistently use id_num and id_code accessor names for stop IDs
Diffstat (limited to 'lib/Travel/Status/DE/EFA/Trip.pm')
-rw-r--r--lib/Travel/Status/DE/EFA/Trip.pm10
1 files changed, 6 insertions, 4 deletions
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,
)
);
}