Loading lib/Travel/Status/DE/DBRIS/Formation/Carriage.pm +21 −8 Original line number Diff line number Diff line Loading @@ -83,6 +83,7 @@ sub new { $ref->{has_first_class} = $json{type}{hasFirstClass}; $ref->{has_second_class} = $json{type}{hasEconomyClass}; if ( $ref->{type} ) { if ( $ref->{type} =~ m{AB} ) { $ref->{class_type} = 12; } Loading @@ -92,6 +93,7 @@ sub new { elsif ( $ref->{type} =~ m{B|WR} ) { $ref->{class_type} = 2; } } my $pos = $json{platformPosition}; my $platform_length = $platform->{end} - $platform->{start}; Loading Loading @@ -147,6 +149,11 @@ sub parse_type { my $type = $self->{type}; my @desc; if ( not $type ) { $self->{attributes} = []; return; } if ( $type =~ m{^D} ) { $self->{is_dosto} = 1; push( @desc, 'Doppelstock' ); Loading Loading @@ -201,6 +208,9 @@ sub parse_type { sub is_first_class { my ($self) = @_; if ( not defined $self->{type} ) { return; } if ( $self->{type} =~ m{^D?A} ) { return 1; } Loading @@ -210,6 +220,9 @@ sub is_first_class { sub is_second_class { my ($self) = @_; if ( not defined $self->{type} ) { return; } if ( $self->{type} =~ m{^D?A?B} ) { return 1; } Loading Loading
lib/Travel/Status/DE/DBRIS/Formation/Carriage.pm +21 −8 Original line number Diff line number Diff line Loading @@ -83,6 +83,7 @@ sub new { $ref->{has_first_class} = $json{type}{hasFirstClass}; $ref->{has_second_class} = $json{type}{hasEconomyClass}; if ( $ref->{type} ) { if ( $ref->{type} =~ m{AB} ) { $ref->{class_type} = 12; } Loading @@ -92,6 +93,7 @@ sub new { elsif ( $ref->{type} =~ m{B|WR} ) { $ref->{class_type} = 2; } } my $pos = $json{platformPosition}; my $platform_length = $platform->{end} - $platform->{start}; Loading Loading @@ -147,6 +149,11 @@ sub parse_type { my $type = $self->{type}; my @desc; if ( not $type ) { $self->{attributes} = []; return; } if ( $type =~ m{^D} ) { $self->{is_dosto} = 1; push( @desc, 'Doppelstock' ); Loading Loading @@ -201,6 +208,9 @@ sub parse_type { sub is_first_class { my ($self) = @_; if ( not defined $self->{type} ) { return; } if ( $self->{type} =~ m{^D?A} ) { return 1; } Loading @@ -210,6 +220,9 @@ sub is_first_class { sub is_second_class { my ($self) = @_; if ( not defined $self->{type} ) { return; } if ( $self->{type} =~ m{^D?A?B} ) { return 1; } Loading