diff options
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) = @_; |