diff options
| author | Birte Kristina Friesel <derf@finalrewind.org> | 2025-04-19 15:16:19 +0200 |
|---|---|---|
| committer | Birte Kristina Friesel <derf@finalrewind.org> | 2025-04-19 15:16:19 +0200 |
| commit | 688e89a47dc1509207d09aa6eb04437ff001d8d6 (patch) | |
| tree | 2291d074d351215bdb6f896432ff29f70b73aece /lib | |
| parent | c6a434891f6ac7f87b35d2d98ffee0fdeeedd518 (diff) | |
Journey: Add line_no accessor
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Travel/Status/DE/DBRIS/Journey.pm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Travel/Status/DE/DBRIS/Journey.pm b/lib/Travel/Status/DE/DBRIS/Journey.pm index 66ace1b..c229f63 100644 --- a/lib/Travel/Status/DE/DBRIS/Journey.pm +++ b/lib/Travel/Status/DE/DBRIS/Journey.pm @@ -11,7 +11,7 @@ use Travel::Status::DE::DBRIS::Location; our $VERSION = '0.09'; Travel::Status::DE::DBRIS::Journey->mk_ro_accessors( - qw(day id train train_no type number is_cancelled)); + qw(day id train train_no line_no type number is_cancelled)); sub new { my ( $obj, %opt ) = @_; @@ -47,6 +47,10 @@ sub new { $ref->{number} = $+{line}; } + if (defined $ref->{number} and defined $ref->{train_no} and $ref->{number} ne $ref->{train_no}) { + $ref->{line_no} = $ref->{number}; + } + bless( $ref, $obj ); for my $message ( @{ $json->{himMeldungen} // [] } ) { |
