From e1535415b0ee257b0a475e7de5978612e6153ec3 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Mon, 23 Dec 2024 19:02:16 +0100 Subject: show journey IDs (optional) and messages --- lib/Travel/Status/DE/DBRIS/Journey.pm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'lib/Travel/Status/DE/DBRIS') 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) = @_; -- cgit v1.2.3