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

EFA, Result: parse and expose trainType and trainName fields

parent c7f5e1dc
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -443,6 +443,8 @@ sub results {
		my $countdown     = $e->getAttribute('countdown');
		my $occupancy     = $e->getAttribute('occupancy');
		my $line          = $e_line->getAttribute('number');
		my $train_type    = $e_line->getAttribute('trainType');
		my $train_name    = $e_line->getAttribute('trainName');
		my $train_no      = $e_line->getAttribute('trainNum');
		my $dest          = $e_line->getAttribute('direction');
		my $info          = $e_info->textContent;
@@ -502,6 +504,8 @@ sub results {
				key           => $key,
				lineref       => $line_obj[0] // undef,
				line          => $line,
				train_type    => $train_type,
				train_name    => $train_name,
				train_no      => $train_no,
				destination   => $dest,
				occupancy     => $occupancy,
+10 −1
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ our $VERSION = '1.22';

Travel::Status::DE::EFA::Result->mk_ro_accessors(
	qw(countdown date delay destination is_cancelled info key line lineref
	  mot occupancy operator platform platform_db platform_name sched_date sched_time time train_no type)
	  mot occupancy operator platform platform_db platform_name sched_date sched_time time train_type train_name train_no type)
);

my @mot_mapping = qw{
@@ -254,6 +254,15 @@ Scheduled departure time (HH:MM).

Actual departure time (HH:MM).

=item $departure->train_type

Train type, e.g. "ICE". Typically only defined for long-distance trains.

=item $departure->train_name

Train name, e.g. "ICE International" or "InterCityExpresS" or "Deichgraf".
Typically only defined for long-distance trains.

=item $departure->train_no

Train number. Only defined if departure is a train.