Unverified Commit 2cc84ed0 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Trip: Add product, product_class accessors

parent 6fa6997c
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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},