diff options
author | Daniel Friesel <derf@finalrewind.org> | 2021-03-13 11:39:08 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2021-03-13 11:39:08 +0100 |
commit | b8c760605104322b990674d90940f409c774adff (patch) | |
tree | ffaadad1bc579f8d4fb1f11cf98fa9182c554ec0 /lib/Travel/Routing/DE/EFA/Route/Part.pm | |
parent | a095bb169c206c8b712514433ccceeac64e1d8f9 (diff) |
show occupancy data if available
Diffstat (limited to 'lib/Travel/Routing/DE/EFA/Route/Part.pm')
-rw-r--r-- | lib/Travel/Routing/DE/EFA/Route/Part.pm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/Travel/Routing/DE/EFA/Route/Part.pm b/lib/Travel/Routing/DE/EFA/Route/Part.pm index 3a15fc3..da3d400 100644 --- a/lib/Travel/Routing/DE/EFA/Route/Part.pm +++ b/lib/Travel/Routing/DE/EFA/Route/Part.pm @@ -8,6 +8,12 @@ use parent 'Class::Accessor'; our $VERSION = '2.19'; +my %occupancy = ( + MANY_SEATS => 1, + FEW_SEATS => 2, + STANDING_ONLY => 3 +); + Travel::Routing::DE::EFA::Route::Part->mk_ro_accessors( qw(arrival_platform arrival_stop arrival_date arrival_time arrival_sdate arrival_stime delay @@ -15,6 +21,7 @@ Travel::Routing::DE::EFA::Route::Part->mk_ro_accessors( departure_stop departure_date departure_time departure_sdate departure_stime footpath_duration footpath_type + occupancy train_destination train_line train_product ) ); @@ -24,6 +31,13 @@ sub new { my $ref = \%conf; + if ( $ref->{occupancy} and exists $occupancy{ $ref->{occupancy} } ) { + $ref->{occupancy} = $occupancy{ $ref->{occupancy} }; + } + else { + delete $ref->{occupancy}; + } + return bless( $ref, $obj ); } |