From 3fd3f93c92bc38650eb0653b5cf5c707a5dae747 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Fri, 29 Mar 2024 12:35:56 +0100 Subject: Wagon: add is_closed accessor --- lib/Travel/Status/DE/DBWagenreihung/Wagon.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'lib/Travel/Status/DE') diff --git a/lib/Travel/Status/DE/DBWagenreihung/Wagon.pm b/lib/Travel/Status/DE/DBWagenreihung/Wagon.pm index eddf4b1..ffc3e58 100644 --- a/lib/Travel/Status/DE/DBWagenreihung/Wagon.pm +++ b/lib/Travel/Status/DE/DBWagenreihung/Wagon.pm @@ -12,9 +12,9 @@ our $VERSION = '0.11'; Travel::Status::DE::DBWagenreihung::Wagon->mk_ro_accessors( qw(attributes class_type group_index has_ac has_accessibility has_bahn_comfort has_bike_storage has_bistro has_compartments - has_family_area has_phone_area has_quiet_area is_dosto is_interregio - is_locomotive is_powercar number model multipurpose section train_no - train_subtype type uic_id) + has_family_area has_phone_area has_quiet_area is_closed is_dosto + is_interregio is_locomotive is_powercar number model multipurpose section + train_no train_subtype type uic_id) ); our %type_attributes = ( @@ -74,6 +74,7 @@ sub new { $ref->{has_bistro} = 0; $ref->{is_locomotive} = 0; $ref->{is_powercar} = 0; + $ref->{is_closed} = 0; $ref->{train_no} = $opt{train_no}; $ref->{number} = $opt{wagenordnungsnummer}; $ref->{model} = $opt{fahrzeugnummer}; @@ -87,6 +88,10 @@ sub new { $self->parse_type; + if ( $opt{status} and $opt{status} eq 'GESCHLOSSEN' ) { + $ref->{is_closed} = 1; + } + if ( $opt{kategorie} =~ m{SPEISEWAGEN} ) { $ref->{has_bistro} = 1; } -- cgit v1.2.3