diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2024-10-06 13:20:33 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2024-10-06 13:20:33 +0200 |
commit | cd63901479b6f70e1fe8775fe3a2e35f8a97473b (patch) | |
tree | be1bca241a10a044a12564b72975e7545c2ddfa6 /lib/Travel/Status/DE/EFA.pm | |
parent | e80e841698a2cf10e79b2c61e7128a379faa8767 (diff) |
Parse station-specific info messages
Diffstat (limited to 'lib/Travel/Status/DE/EFA.pm')
-rw-r--r-- | lib/Travel/Status/DE/EFA.pm | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/Travel/Status/DE/EFA.pm b/lib/Travel/Status/DE/EFA.pm index 8b81f28..ba17168 100644 --- a/lib/Travel/Status/DE/EFA.pm +++ b/lib/Travel/Status/DE/EFA.pm @@ -13,6 +13,7 @@ use DateTime::Format::Strptime; use Encode qw(encode); use JSON; use Travel::Status::DE::EFA::Departure; +use Travel::Status::DE::EFA::Info; use Travel::Status::DE::EFA::Line; use Travel::Status::DE::EFA::Services; use Travel::Status::DE::EFA::Stop; @@ -437,6 +438,23 @@ sub stops { return @stops; } +sub infos { + my ($self) = @_; + + if ( $self->{infos} ) { + return @{ $self->{infos} }; + } + + for my $info ( @{ $self->{response}{dm}{points}{point}{infos} // [] } ) { + push( + @{ $self->{infos} }, + Travel::Status::DE::EFA::Info->new( json => $info ) + ); + } + + return @{ $self->{infos} // [] }; +} + sub lines { my ($self) = @_; |