summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-10-04 08:49:01 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-10-04 08:49:01 +0200
commitc808d938c78ef8dea89bee8fee3632497fd5e170 (patch)
tree037cf08848194efb49ceb2a47934b27f0dd84750
parent669aa8b72cdf6d57d6f5f35d50f2a7e2489478e4 (diff)
EFA, Trip: Add stop_id accessor
-rw-r--r--lib/Travel/Status/DE/EFA.pm6
-rw-r--r--lib/Travel/Status/DE/EFA/Stop.pm2
-rw-r--r--lib/Travel/Status/DE/EFA/Trip.pm4
3 files changed, 10 insertions, 2 deletions
diff --git a/lib/Travel/Status/DE/EFA.pm b/lib/Travel/Status/DE/EFA.pm
index ada3b86..2fdaefc 100644
--- a/lib/Travel/Status/DE/EFA.pm
+++ b/lib/Travel/Status/DE/EFA.pm
@@ -394,6 +394,12 @@ sub stop_name {
return $self->{response}{dm}{points}{point}{name};
}
+sub stop_id {
+ my ($self) = @_;
+
+ return $self->{response}{dm}{points}{point}{stateless};
+}
+
sub stops {
my ($self) = @_;
diff --git a/lib/Travel/Status/DE/EFA/Stop.pm b/lib/Travel/Status/DE/EFA/Stop.pm
index 5dd9e35..e760713 100644
--- a/lib/Travel/Status/DE/EFA/Stop.pm
+++ b/lib/Travel/Status/DE/EFA/Stop.pm
@@ -12,7 +12,7 @@ Travel::Status::DE::EFA::Stop->mk_ro_accessors(
qw(sched_arr rt_arr arr arr_delay
sched_dep rt_dep dep dep_delay
occupancy delay
- place name full_name id latlon
+ place name full_name id stop_id latlon
platform niveau)
);
diff --git a/lib/Travel/Status/DE/EFA/Trip.pm b/lib/Travel/Status/DE/EFA/Trip.pm
index 37e5284..b61c215 100644
--- a/lib/Travel/Status/DE/EFA/Trip.pm
+++ b/lib/Travel/Status/DE/EFA/Trip.pm
@@ -68,7 +68,7 @@ sub route {
for my $stop ( @{ $self->{route_raw} // [] } ) {
my $chain = $stop;
- my ( $platform, $place, $name, $name_full );
+ my ( $platform, $place, $name, $name_full, $stop_id );
while ( $chain->{type} ) {
if ( $chain->{type} eq 'platform' ) {
$platform = $chain->{properties}{platformName}
@@ -77,6 +77,7 @@ sub route {
elsif ( $chain->{type} eq 'stop' ) {
$name = $chain->{disassembledName};
$name_full = $chain->{name};
+ $stop_id = $chain->{properties}{stopId};
}
elsif ( $chain->{type} eq 'locality' ) {
$place = $chain->{name};
@@ -97,6 +98,7 @@ sub route {
niveau => $stop->{niveau},
platform => $platform,
id => $stop->{id},
+ stop_id => $stop_id,
)
);
}