diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2024-12-24 10:01:08 +0100 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2024-12-24 10:01:08 +0100 |
commit | 9cb71f78d09b8dc6e7b431c31c2cfac7657d7682 (patch) | |
tree | 53531d309d9e5e71fa4d5a12d9fccbb6a7784331 /lib/Travel/Status/DE/DBRIS/Location.pm | |
parent | e1535415b0ee257b0a475e7de5978612e6153ec3 (diff) |
add journey support
Diffstat (limited to 'lib/Travel/Status/DE/DBRIS/Location.pm')
-rw-r--r-- | lib/Travel/Status/DE/DBRIS/Location.pm | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/lib/Travel/Status/DE/DBRIS/Location.pm b/lib/Travel/Status/DE/DBRIS/Location.pm index f053f2b..2dfba2c 100644 --- a/lib/Travel/Status/DE/DBRIS/Location.pm +++ b/lib/Travel/Status/DE/DBRIS/Location.pm @@ -9,7 +9,9 @@ use parent 'Class::Accessor'; our $VERSION = '0.01'; Travel::Status::DE::DBRIS::Location->mk_ro_accessors( - qw(eva id lat lon name products type is_cancelled is_additional is_separation display_priority) + qw(eva id lat lon name products type is_cancelled is_additional is_separation display_priority + dep arr platform + ) ); sub new { @@ -27,9 +29,30 @@ sub new { type => $json->{type}, is_cancelled => $json->{canceled}, is_additional => $json->{additional}, - + platform => $json->{gleis}, + rt_platform => $json->{ezGleis}, }; + if ( $json->{abfahrtsZeitpunkt} ) { + $ref->{sched_dep} + = $opt{strptime_obj}->parse_datetime( $json->{abfahrtsZeitpunkt} ); + } + if ( $json->{ezAbfahrtsZeitpunkt} ) { + $ref->{rt_dep} + = $opt{strptime_obj}->parse_datetime( $json->{ezAbfahrtsZeitpunkt} ); + } + if ( $json->{ankunftsZeitpunkt} ) { + $ref->{sched_arr} + = $opt{strptime_obj}->parse_datetime( $json->{ankunftsZeitpunkt} ); + } + if ( $json->{ezAnkunftsZeitpunkt} ) { + $ref->{rt_arr} + = $opt{strptime_obj}->parse_datetime( $json->{ezAnkunftsZeitpunkt} ); + } + + $ref->{arr} = $ref->{rt_arr} // $ref->{sched_arr}; + $ref->{dep} = $ref->{rt_dep} // $ref->{sched_dep}; + bless( $ref, $obj ); return $ref; |