summaryrefslogtreecommitdiff
path: root/lib/Travel/Routing/DE/HAFAS.pm
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-03-27 06:40:08 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2024-03-27 06:40:08 +0100
commit293d2d1a4fbfd294f18f9c632703dcae04f28ee4 (patch)
tree37d4a075d384fef056d91acb2add1f7e76b7d4b7 /lib/Travel/Routing/DE/HAFAS.pm
parentfc95f2a3ceef03f076ee268d71ce11d5765a6c37 (diff)
Adjust for Travel::Status::DE::HAFAS 6.00 (unreleased)
Diffstat (limited to 'lib/Travel/Routing/DE/HAFAS.pm')
-rw-r--r--lib/Travel/Routing/DE/HAFAS.pm12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/Travel/Routing/DE/HAFAS.pm b/lib/Travel/Routing/DE/HAFAS.pm
index 1ced8e8..f607908 100644
--- a/lib/Travel/Routing/DE/HAFAS.pm
+++ b/lib/Travel/Routing/DE/HAFAS.pm
@@ -536,8 +536,17 @@ sub check_mgate {
sub parse_trips {
my ($self) = @_;
+ my $common = $self->{raw_json}{svcResL}[0]{res}{common};
+
my @locL = map { Travel::Status::DE::HAFAS::Location->new( loc => $_ ) }
- @{ $self->{raw_json}{svcResL}[0]{res}{common}{locL} // [] };
+ @{ $common->{locL} // [] };
+
+ my @prodL = map {
+ Travel::Status::DE::HAFAS::Product->new(
+ common => $common,
+ product => $_
+ )
+ } @{ $common->{prodL} // [] };
my @conL = @{ $self->{raw_json}{svcResL}[0]{res}{outConL} // [] };
for my $con (@conL) {
@@ -546,6 +555,7 @@ sub parse_trips {
Travel::Routing::DE::HAFAS::Connection->new(
common => $self->{raw_json}{svcResL}[0]{res}{common},
locL => \@locL,
+ prodL => \@prodL,
connection => $con,
hafas => $self,
)