diff options
Diffstat (limited to 'lib/Travel')
-rw-r--r-- | lib/Travel/Status/DE/IRIS/Result.pm | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/Travel/Status/DE/IRIS/Result.pm b/lib/Travel/Status/DE/IRIS/Result.pm index 75bff00..847682f 100644 --- a/lib/Travel/Status/DE/IRIS/Result.pm +++ b/lib/Travel/Status/DE/IRIS/Result.pm @@ -98,6 +98,30 @@ my %translation = ( 900 => 'Anschlussbus wartet(?)', ); +my %linemap = ( + RE => { + 100 => 11, + 101 => 1, + 102 => 2, + 104 => 4, + 105 => 5, + 106 => 6, + 112 => 42, + }, + S => { + 301 => 1, + 303 => 3, + 306 => 6, + 308 => '8', + 309 => 9, + 311 => 1, + 312 => 2, + 313 => 3, + 315 => 5, + 316 => 6, + } +); + Travel::Status::DE::IRIS::Result->mk_ro_accessors( qw(arrival date datetime delay departure is_cancelled is_transfer is_unscheduled is_wing line_no old_train_id old_train_no platform raw_id @@ -178,6 +202,11 @@ sub new { $ref->{is_cancelled} = 0; + if ( not defined $ref->{line_no} ) { + my $train_prefix = substr( $ref->{train_no}, 0, 3 ); + $ref->{line_no} = $linemap{ $ref->{type} }{$train_prefix}; + } + return bless( $ref, $obj ); } |