Loading lib/Travel/Status/DE/DBRIS.pm +4 −3 Original line number Diff line number Diff line Loading @@ -153,7 +153,7 @@ sub new { $self->parse_stationboard; } elsif ( $conf{journey} ) { $self->parse_journey; $self->parse_journey( id => $conf{journey} ); } elsif ( $conf{geoSearch} or $conf{locationSearch} ) { $self->parse_search; Loading Loading @@ -194,7 +194,7 @@ sub new_p { $self->parse_stationboard; } elsif ( $conf{journey} ) { $self->parse_journey; $self->parse_journey( id => $conf{journey} ); } elsif ( $conf{geoSearch} or $conf{locationSearch} ) { $self->parse_search; Loading Loading @@ -312,9 +312,10 @@ sub get_with_cache_p { } sub parse_journey { my ($self) = @_; my ( $self, %opt ) = @_; $self->{result} = Travel::Status::DE::DBRIS::Journey->new( id => $opt{id}, json => $self->{raw_json}, strpdate_obj => $self->{strpdate_obj}, strptime_obj => $self->{strptime_obj}, Loading lib/Travel/Status/DE/DBRIS/Journey.pm +9 −1 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ use Travel::Status::DE::DBRIS::Location; our $VERSION = '0.07'; Travel::Status::DE::DBRIS::Journey->mk_ro_accessors( qw(day train type number is_cancelled)); qw(day id train type number is_cancelled)); sub new { my ( $obj, %opt ) = @_; Loading @@ -21,6 +21,7 @@ sub new { my $strptime = $opt{strptime_obj}; my $ref = { id => $opt{id}, day => $strpdate->parse_datetime( $json->{reisetag} ), train => $json->{zugName}, is_cancelled => $json->{cancelled}, Loading @@ -33,6 +34,13 @@ sub new { # with no way of distinguishing between those ( $ref->{type}, $ref->{number} ) = split( qr{\s+}, $ref->{train} ); # The line number seems to be encoded in the trip ID if ( not defined $ref->{number} and $opt{id} =~ m{ [#] ZE [#] (?<line> [^#]+ ) [#] ZB [#] }x ) { $ref->{number} = $+{line}; } bless( $ref, $obj ); for my $message ( @{ $json->{himMeldungen} // [] } ) { Loading Loading
lib/Travel/Status/DE/DBRIS.pm +4 −3 Original line number Diff line number Diff line Loading @@ -153,7 +153,7 @@ sub new { $self->parse_stationboard; } elsif ( $conf{journey} ) { $self->parse_journey; $self->parse_journey( id => $conf{journey} ); } elsif ( $conf{geoSearch} or $conf{locationSearch} ) { $self->parse_search; Loading Loading @@ -194,7 +194,7 @@ sub new_p { $self->parse_stationboard; } elsif ( $conf{journey} ) { $self->parse_journey; $self->parse_journey( id => $conf{journey} ); } elsif ( $conf{geoSearch} or $conf{locationSearch} ) { $self->parse_search; Loading Loading @@ -312,9 +312,10 @@ sub get_with_cache_p { } sub parse_journey { my ($self) = @_; my ( $self, %opt ) = @_; $self->{result} = Travel::Status::DE::DBRIS::Journey->new( id => $opt{id}, json => $self->{raw_json}, strpdate_obj => $self->{strpdate_obj}, strptime_obj => $self->{strptime_obj}, Loading
lib/Travel/Status/DE/DBRIS/Journey.pm +9 −1 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ use Travel::Status::DE::DBRIS::Location; our $VERSION = '0.07'; Travel::Status::DE::DBRIS::Journey->mk_ro_accessors( qw(day train type number is_cancelled)); qw(day id train type number is_cancelled)); sub new { my ( $obj, %opt ) = @_; Loading @@ -21,6 +21,7 @@ sub new { my $strptime = $opt{strptime_obj}; my $ref = { id => $opt{id}, day => $strpdate->parse_datetime( $json->{reisetag} ), train => $json->{zugName}, is_cancelled => $json->{cancelled}, Loading @@ -33,6 +34,13 @@ sub new { # with no way of distinguishing between those ( $ref->{type}, $ref->{number} ) = split( qr{\s+}, $ref->{train} ); # The line number seems to be encoded in the trip ID if ( not defined $ref->{number} and $opt{id} =~ m{ [#] ZE [#] (?<line> [^#]+ ) [#] ZB [#] }x ) { $ref->{number} = $+{line}; } bless( $ref, $obj ); for my $message ( @{ $json->{himMeldungen} // [] } ) { Loading