diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Travel/Status/DE/DBRIS/Journey.pm | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/Travel/Status/DE/DBRIS/Journey.pm b/lib/Travel/Status/DE/DBRIS/Journey.pm index 6e420f4..47dd726 100644 --- a/lib/Travel/Status/DE/DBRIS/Journey.pm +++ b/lib/Travel/Status/DE/DBRIS/Journey.pm @@ -9,7 +9,7 @@ use parent 'Class::Accessor'; our $VERSION = '0.01'; Travel::Status::DE::DBRIS::Journey->mk_ro_accessors( - qw(type dep sched_dep rt_dep delay is_cancelled line stop_eva journey_id platform rt_platform dest_name via) + qw(type dep sched_dep rt_dep delay is_cancelled line stop_eva id platform rt_platform destination via via_last) ); sub new { @@ -21,12 +21,13 @@ sub new { my $ref = { type => $json->{verkehrmittel}{kurzText}, line => $json->{verkehrmittel}{mittelText}, - journey_id => $json->{journeyID}, + id => $json->{journeyId}, stop_eva => $json->{bahnhofsId}, - dest_name => $json->{terminus}, + destination => $json->{terminus}, platform => $json->{gleis}, rt_platform => $json->{ezGleis}, via => $json->{ueber}, + via_last => ( $json->{ueber} // [] )->[-1], }; bless( $ref, $obj ); @@ -69,6 +70,12 @@ sub route { return @{ $self->{route} }; } +sub messages { + my ($self) = @_; + + return @{ $self->{messages} // [] }; +} + sub TO_JSON { my ($self) = @_; |