Commit 187e1754 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Result: Add operator accessor

parent 25eb5e0b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -318,6 +318,7 @@ sub results {
		my $delay         = $tr->getAttribute('delay');
		my $e_delay       = $tr->getAttribute('e_delay');
		my $info          = $tr->getAttribute('delayReason');
		my $operator      = $tr->getAttribute('operator');
		my @messages;

		if ( not( $time and $dest ) ) {
@@ -360,6 +361,7 @@ sub results {
				messages       => \@messages,
				sched_time     => $time,
				train          => $train,
				operator       => $operator,
				route_end      => $dest,
				platform       => $platform,
				new_platform   => $new_platform,
+9 −2
Original line number Diff line number Diff line
@@ -11,8 +11,8 @@ use parent 'Class::Accessor';
our $VERSION = '3.01';

Travel::Status::DE::HAFAS::Result->mk_ro_accessors(
	qw(sched_date date sched_datetime datetime info raw_e_delay raw_delay
	  sched_time time train route_end)
	qw(sched_date date sched_datetime datetime info operator raw_e_delay
	  raw_delay sched_time time train route_end)
);

sub new {
@@ -279,6 +279,13 @@ Returns the line/train number, for instance "SB16" (bus line SB16),
Note that this may not be a number at all: Some transport services also
use single-letter characters or words (e.g. "AIR") as line numbers.

=item $result->operator

Returns the operator responsible for this arrival/departure. Returns undef
if the backend does not provide an operator.

Note that E<Ouml>BB is the only known backend providing this information.

=item $result->platform

Returns the arrival/departure platform.