Commit b95c42c1 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Result: Add sched_platform accessor

parent 820e8c29
Loading
Loading
Loading
Loading
+19 −4
Original line number Original line Diff line number Diff line
@@ -18,9 +18,9 @@ our $VERSION = '0.02';
Travel::Status::DE::IRIS::Result->mk_ro_accessors(
Travel::Status::DE::IRIS::Result->mk_ro_accessors(
	qw(arrival classes date datetime delay departure is_cancelled is_transfer
	qw(arrival classes date datetime delay departure is_cancelled is_transfer
	  line_no old_train_id old_train_no platform raw_id realtime_xml
	  line_no old_train_id old_train_no platform raw_id realtime_xml
	  route_start route_end sched_arrival sched_departure sched_route_start
	  route_start route_end sched_arrival sched_departure sched_platform
	  sched_route_end start stop_no time train_id train_no transfer type
	  sched_route_start sched_route_end start stop_no time train_id train_no
	  unknown_t unknown_o)
	  transfer type unknown_t unknown_o)
);
);


sub new {
sub new {
@@ -76,6 +76,7 @@ sub new {
	$ref->{route_pre_incomplete}  = $ref->{route_end}  ? 1 : 0;
	$ref->{route_pre_incomplete}  = $ref->{route_end}  ? 1 : 0;
	$ref->{route_post_incomplete} = $ref->{route_post} ? 1 : 0;
	$ref->{route_post_incomplete} = $ref->{route_post} ? 1 : 0;


	$ref->{sched_platform} = $ref->{platform};
	$ref->{route_end}
	$ref->{route_end}
	  = $ref->{sched_route_end}
	  = $ref->{sched_route_end}
	  = $ref->{route_end}
	  = $ref->{route_end}
@@ -107,6 +108,10 @@ sub add_ar {
		  ->in_units('minutes');
		  ->in_units('minutes');
	}
	}


	if ( $attrib{platform} ) {
		$self->{platform} = $attrib{platform};
	}

	if ( $attrib{route_pre} ) {
	if ( $attrib{route_pre} ) {
		$self->{route_pre} = [ split( qr{[|]}, $attrib{route_pre} // q{} ) ];
		$self->{route_pre} = [ split( qr{[|]}, $attrib{route_pre} // q{} ) ];
		$self->{route_start} = $self->{route_pre}[0];
		$self->{route_start} = $self->{route_pre}[0];
@@ -134,6 +139,10 @@ sub add_dp {
		  ->in_units('minutes');
		  ->in_units('minutes');
	}
	}


	if ( $attrib{platform} ) {
		$self->{platform} = $attrib{platform};
	}

	if ( $attrib{route_post} ) {
	if ( $attrib{route_post} ) {
		$self->{route_post} = [ split( qr{[|]}, $attrib{route_post} // q{} ) ];
		$self->{route_post} = [ split( qr{[|]}, $attrib{route_post} // q{} ) ];
		$self->{route_end} = $self->{route_post}[-1];
		$self->{route_end} = $self->{route_post}[-1];
@@ -641,7 +650,7 @@ case of a duplicate, only the most recent message is present)


=item $result->platform
=item $result->platform


Arrivel/departure platform as string, undef if unknown. Note that this is
Arrival/departure platform as string, undef if unknown. Note that this is
not neccessarily a number, platform sections may be included (e.g.
not neccessarily a number, platform sections may be included (e.g.
C<< 3a/b >>).
C<< 3a/b >>).


@@ -702,6 +711,12 @@ train starts here.
DateTime(3pm) object for the scehduled departure date and time. undef if the
DateTime(3pm) object for the scehduled departure date and time. undef if the
train ends here.
train ends here.


=item $result->sched_platform

Scheduled Arrival/departure platform as string, undef if unknown. Note that
this is not neccessarily a number, platform sections may be included (e.g.  C<<
3a/b >>).

=item $result->sched_route
=item $result->sched_route


List of all stations served by this train, according to its schedule. Does
List of all stations served by this train, according to its schedule. Does