trptime;
use Digest::MD5 qw(md5_hex);
use Encode qw(decode encode);
use IO::Socket::SSL;
use JSON;
use LWP::UserAgent;
use Travel::Status::DE::HAFAS::Journey;
use Travel::Status::DE::HAFAS::Locat
my $json = $self->{json} = JSON->new->utf8;
# The JSON request is the cache key, so if we have a cache we must ensure
# that JSON serialization is deterministic.
if ( $self->{cache} ) {
$json->c
anonical;
}
$req = $json->encode($req);
$self->{post} = $req;
my $url = $conf{url} // $hafas_instance->{$service}{mgate};
if ( my $salt = $hafas_instance->{$service}{salt} ) {
if ( $hafas_in
($self) = @_;
if ( $self->{messages} ) {
return @{ $self->{messages} };
}
return;
}
sub TO_JSON {
my ($self) = @_;
my $ret = { %{$self} };
for my $k ( keys %{$ret} ) {
if ( ref( $ret->{$
loc->eva eq $req_stop ) {
return $stop->prod_dep // $stop->prod_arr;
}
}
return;
}
sub TO_JSON {
my ($self) = @_;
my $ret = { %{$self} };
for my $k ( keys %{$ret} ) {
if ( ref( $ret->{$
=> $class,
operator => $operator,
};
bless( $ref, $obj );
return $ref;
}
# }}}
sub TO_JSON {
my ($self) = @_;
return { %{$self} };
}
1;
__END__
=head1 NAME
Travel::Status::DE::HAFAS
=> $loc->{wt},
distance_m => $loc->{dist},
};
bless( $ref, $obj );
return $ref;
}
sub TO_JSON {
my ($self) = @_;
my $ret = { %{$self} };
return $ret;
}
1;
__END__
=head1 NAME
Travel:
se strict;
use warnings;
use 5.014;
use utf8;
use Carp qw(confess);
use Encode qw(decode);
use JSON;
use LWP::UserAgent;
our $VERSION = '6.23';
# {{{ Constructors
sub new {
my ( $obj, %conf ) =
on [(] [)] ; $ }{}x;
if ( $ref->{developer_mode} ) {
say $ref->{raw_reply};
}
$ref->{json} = from_json( $ref->{raw_reply} );
return $ref;
}
sub new_p {
my ( $obj, %conf ) = @_;
my $promise
; $ }{}x;
if ( $self->{developer_mode} ) {
say $self->{raw_reply};
}
$self->{json} = from_json( $self->{raw_reply} );
$promise->resolve( $self->results );
return;
}
)->catch(
_;
my $json = $conf{json};
my $is_him = $conf{is_him};
my $short = $json->{txtS};
my $text = $json->{txtN};
my $type = $json->{type};
my $code = $json->{code};
my $prio = $json->{prio};
if ($is_him) {
$short = $json->{head};
$text = $json->{text};
$code = $json->{hid};
}
my $ref = {
short => $short,
text => $text,
type => $type,
code => $code,
=> $is_him,
ref_count => $conf{ref_count},
};
bless( $ref, $obj );
return $ref;
}
sub TO_JSON {
my ($self) = @_;
return { %{$self} };
}
1;
__END__
=head1 NAME
Travel::Status::DE::HAFAS