From 2cc84ed0a8a877d969d0ca74ed55e6d0a6e94549 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Thu, 3 Oct 2024 12:11:25 +0200 Subject: Trip: Add product, product_class accessors --- lib/Travel/Status/DE/EFA/Trip.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/Travel/Status/DE/EFA/Trip.pm') diff --git a/lib/Travel/Status/DE/EFA/Trip.pm b/lib/Travel/Status/DE/EFA/Trip.pm index b1e3437..a34e6fe 100644 --- a/lib/Travel/Status/DE/EFA/Trip.pm +++ b/lib/Travel/Status/DE/EFA/Trip.pm @@ -12,7 +12,7 @@ use parent 'Class::Accessor'; our $VERSION = '3.00'; Travel::Status::DE::EFA::Trip->mk_ro_accessors( - qw(operator name line number type id dest_name dest_id)); + qw(operator product product_class name line number type id dest_name dest_id)); sub new { my ( $obj, %conf ) = @_; @@ -21,11 +21,13 @@ sub new { my $ref = { operator => $json->{operator}{name}, + product => $json->{product}{name}, + product_class => $json->{product}{class}, polyline => $json->{coords}, name => $json->{name}, line => $json->{disassembledName}, number => $json->{properties}{trainNumber}, - type => $json->{properties}{trainType}, + type => $json->{properties}{trainType} // $json->{product}{name}, id => $json->{id}, dest_name => $json->{destination}{name}, dest_id => $json->{destination}{id}, -- cgit v1.2.3