summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-12-26 13:26:43 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2024-12-26 13:26:43 +0100
commit5720802d4d827b071c8db0c54cbf94f7886f715d (patch)
treed56d071239d6a99a3586e3e303fcf8a3fab343c0 /lib/Travel/Status/DE
parent12cda626007af91cc84cf5303adddcb3eeaf8b95 (diff)
Location: Distinguish between sched(?)_platform and rt_platform
Diffstat (limited to 'lib/Travel/Status/DE')
-rw-r--r--lib/Travel/Status/DE/DBRIS/Location.pm29
1 files changed, 15 insertions, 14 deletions
diff --git a/lib/Travel/Status/DE/DBRIS/Location.pm b/lib/Travel/Status/DE/DBRIS/Location.pm
index 2dfba2c..63b26ac 100644
--- a/lib/Travel/Status/DE/DBRIS/Location.pm
+++ b/lib/Travel/Status/DE/DBRIS/Location.pm
@@ -10,7 +10,7 @@ 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
- dep arr platform
+ dep arr platform sched_platform rt_platform
)
);
@@ -20,17 +20,17 @@ sub new {
my $json = $opt{json};
my $ref = {
- eva => $json->{extId} // $json->{evaNumber},
- id => $json->{id},
- lat => $json->{lat},
- lon => $json->{lon},
- name => $json->{name},
- products => $json->{products},
- type => $json->{type},
- is_cancelled => $json->{canceled},
- is_additional => $json->{additional},
- platform => $json->{gleis},
- rt_platform => $json->{ezGleis},
+ eva => $json->{extId} // $json->{evaNumber},
+ id => $json->{id},
+ lat => $json->{lat},
+ lon => $json->{lon},
+ name => $json->{name},
+ products => $json->{products},
+ type => $json->{type},
+ is_cancelled => $json->{canceled},
+ is_additional => $json->{additional},
+ sched_platform => $json->{gleis},
+ rt_platform => $json->{ezGleis},
};
if ( $json->{abfahrtsZeitpunkt} ) {
@@ -50,8 +50,9 @@ sub new {
= $opt{strptime_obj}->parse_datetime( $json->{ezAnkunftsZeitpunkt} );
}
- $ref->{arr} = $ref->{rt_arr} // $ref->{sched_arr};
- $ref->{dep} = $ref->{rt_dep} // $ref->{sched_dep};
+ $ref->{arr} = $ref->{rt_arr} // $ref->{sched_arr};
+ $ref->{dep} = $ref->{rt_dep} // $ref->{sched_dep};
+ $ref->{platform} = $ref->{rt_platform} // $ref->{sched_platform};
bless( $ref, $obj );