summaryrefslogtreecommitdiff
path: root/lib/Travel/Status
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-09-22 15:19:21 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-09-22 15:19:21 +0200
commitc0e55de50c380638e0f3668cac79c58b4dccde10 (patch)
tree0a49c2ce878c04063ef2a1d53f0cb83f12a54111 /lib/Travel/Status
parent3dd1b3a53d48c5b1c76418fe37823ea97e58ccde (diff)
add accessors for identified stop
Diffstat (limited to 'lib/Travel/Status')
-rw-r--r--lib/Travel/Status/DE/EFA.pm29
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/Travel/Status/DE/EFA.pm b/lib/Travel/Status/DE/EFA.pm
index ab029df..8774d59 100644
--- a/lib/Travel/Status/DE/EFA.pm
+++ b/lib/Travel/Status/DE/EFA.pm
@@ -346,6 +346,35 @@ sub check_for_ambiguous {
return;
}
+sub stop_name {
+ my ($self) = @_;
+
+ return $self->{response}{dm}{points}{point}{name};
+}
+
+sub stops {
+ my ($self) = @_;
+
+ if ( $self->{stops} ) {
+ return @{ $self->{stops} };
+ }
+
+ my @stops;
+ for my $stop ( @{ $self->{response}{dm}{itdOdvAssignedStops} // [] } ) {
+ push(
+ @stops,
+ Travel::Status::DE::EFA::Stop->new(
+ place => $stop->{place},
+ name => $stop->{name},
+ full_name => $stop->{nameWithPlace},
+ )
+ );
+ }
+
+ $self->{stops} = \@stops;
+ return @stops;
+}
+
sub lines {
my ($self) = @_;