diff options
Diffstat (limited to 'lib/Travel')
-rw-r--r-- | lib/Travel/Status/DE/DBRIS/JourneyAtStop.pm | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/Travel/Status/DE/DBRIS/JourneyAtStop.pm b/lib/Travel/Status/DE/DBRIS/JourneyAtStop.pm index f01786a..9ed5270 100644 --- a/lib/Travel/Status/DE/DBRIS/JourneyAtStop.pm +++ b/lib/Travel/Status/DE/DBRIS/JourneyAtStop.pm @@ -9,7 +9,7 @@ use parent 'Class::Accessor'; our $VERSION = '0.05'; Travel::Status::DE::DBRIS::JourneyAtStop->mk_ro_accessors( - qw(type dep sched_dep rt_dep delay is_cancelled line stop_eva id platform rt_platform destination via via_last + qw(type dep sched_dep rt_dep delay is_cancelled line stop_eva id platform rt_platform destination via_last train_short train_mid train_long train maybe_train_no maybe_line_no ) ); @@ -36,6 +36,10 @@ sub new { via_last => ( $json->{ueber} // [] )->[-1], }; + if ( $ref->{via} and @{ $ref->{via} } ) { + shift( @{ $ref->{via} } ); + } + $ref->{maybe_train_no} = $ref->{train} =~ s{^.* ++}{}r; $ref->{maybe_line_no} = $ref->{train_mid} =~ s{^.* ++}{}r; @@ -70,6 +74,12 @@ sub messages { return @{ $self->{messages} // [] }; } +sub via { + my ($self) = @_; + + return @{ $self->{via} // [] }; +} + sub TO_JSON { my ($self) = @_; |