Loading lib/Travel/Routing/DE/HAFAS.pm +47 −65 Original line number Diff line number Diff line Loading @@ -216,9 +216,6 @@ sub new { my $req; if (0) { } else { my $date = ( $conf{datetime} // $now )->strftime('%Y%m%d'); my $time = ( $conf{datetime} // $now )->strftime('%H%M%S'); Loading Loading @@ -266,7 +263,6 @@ sub new { ], %{ $hafas_instance{$service}{request} } }; } if ( $conf{language} ) { $req->{lang} = $conf{language}; Loading Loading @@ -338,14 +334,9 @@ sub new_p { my ( $obj, %conf ) = @_; my $promise = $conf{promise}->new; if ( not( $conf{station} or $conf{journey} or $conf{geoSearch} or $conf{locationSearch} ) ) { return $promise->reject('station or journey flag must be passed'); if ( not( $conf{from_stop} and $conf{to_stop} ) ) { confess('from_stop and to_stop must be specified'); return $promise->reject('from_stop and to_stop must be specified'); } my $self = $obj->new( %conf, async => 1 ); Loading @@ -356,15 +347,7 @@ sub new_p { my ($content) = @_; $self->{raw_json} = $self->{json}->decode($content); $self->check_mgate; if ( $conf{journey} ) { $self->parse_journey; } elsif ( $conf{geoSearch} or $conf{locationSearch} ) { $self->parse_search; } else { $self->parse_board; } $self->parse_trips; if ( $self->errstr ) { $promise->reject( $self->errstr, $self ); } Loading Loading @@ -448,7 +431,6 @@ sub post_with_cache { my $content = $reply->content; if ($cache) { say "freeeez"; $cache->freeze( $self->{post}, \$content ); } Loading Loading
lib/Travel/Routing/DE/HAFAS.pm +47 −65 Original line number Diff line number Diff line Loading @@ -216,9 +216,6 @@ sub new { my $req; if (0) { } else { my $date = ( $conf{datetime} // $now )->strftime('%Y%m%d'); my $time = ( $conf{datetime} // $now )->strftime('%H%M%S'); Loading Loading @@ -266,7 +263,6 @@ sub new { ], %{ $hafas_instance{$service}{request} } }; } if ( $conf{language} ) { $req->{lang} = $conf{language}; Loading Loading @@ -338,14 +334,9 @@ sub new_p { my ( $obj, %conf ) = @_; my $promise = $conf{promise}->new; if ( not( $conf{station} or $conf{journey} or $conf{geoSearch} or $conf{locationSearch} ) ) { return $promise->reject('station or journey flag must be passed'); if ( not( $conf{from_stop} and $conf{to_stop} ) ) { confess('from_stop and to_stop must be specified'); return $promise->reject('from_stop and to_stop must be specified'); } my $self = $obj->new( %conf, async => 1 ); Loading @@ -356,15 +347,7 @@ sub new_p { my ($content) = @_; $self->{raw_json} = $self->{json}->decode($content); $self->check_mgate; if ( $conf{journey} ) { $self->parse_journey; } elsif ( $conf{geoSearch} or $conf{locationSearch} ) { $self->parse_search; } else { $self->parse_board; } $self->parse_trips; if ( $self->errstr ) { $promise->reject( $self->errstr, $self ); } Loading Loading @@ -448,7 +431,6 @@ sub post_with_cache { my $content = $reply->content; if ($cache) { say "freeeez"; $cache->freeze( $self->{post}, \$content ); } Loading