summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Travel/Status/DE')
-rw-r--r--lib/Travel/Status/DE/DBRIS/Journey.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Travel/Status/DE/DBRIS/Journey.pm b/lib/Travel/Status/DE/DBRIS/Journey.pm
index d993b88..2b92341 100644
--- a/lib/Travel/Status/DE/DBRIS/Journey.pm
+++ b/lib/Travel/Status/DE/DBRIS/Journey.pm
@@ -10,7 +10,8 @@ use Travel::Status::DE::DBRIS::Location;
our $VERSION = '0.06';
-Travel::Status::DE::DBRIS::Journey->mk_ro_accessors(qw(day train is_cancelled));
+Travel::Status::DE::DBRIS::Journey->mk_ro_accessors(
+ qw(day train type number is_cancelled));
sub new {
my ( $obj, %opt ) = @_;
@@ -28,6 +29,10 @@ sub new {
strptime_obj => $strptime,
};
+ # Number is either train no (ICE, RE) or line no (S, U, Bus, ...)
+ # with no way of distinguishing between those
+ ( $ref->{type}, $ref->{number} ) = split( qr{\s+}, $ref->{train} );
+
bless( $ref, $obj );
for my $message ( @{ $json->{himMeldungen} // [] } ) {