summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE/DBRIS
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-12-23 19:02:16 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2024-12-23 19:02:16 +0100
commite1535415b0ee257b0a475e7de5978612e6153ec3 (patch)
treec2819324c2cb23a706fa4f61559327538b3271a4 /lib/Travel/Status/DE/DBRIS
parent2d9a53966da3abee99dd03d94cd39d0043cbb01a (diff)
show journey IDs (optional) and messages
Diffstat (limited to 'lib/Travel/Status/DE/DBRIS')
-rw-r--r--lib/Travel/Status/DE/DBRIS/Journey.pm13
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) = @_;