Skip to content
Commits on Source (2)
Travel::Status::DE::DeutscheBahn 6.03 - Mon Apr 15 2024
* Journey: Add product_at accessor
Travel::Status::DE::DeutscheBahn 6.02 - Fri Apr 12 2024
* hafas-m: Add -j / --with-jid option
......
......@@ -3,7 +3,7 @@ use strict;
use warnings;
use 5.014;
our $VERSION = '6.02';
our $VERSION = '6.03';
use utf8;
use DateTime;
......@@ -681,7 +681,7 @@ B<hafas-m> [B<-s> I<service>] [B<-l> I<language>] B<!>I<query>|I<journeyID>
=head1 VERSION
version 6.02
version 6.03
=head1 DESCRIPTION
......
......@@ -6,7 +6,7 @@ use 5.014;
use parent 'Travel::Status::DE::HAFAS';
our $VERSION = '6.02';
our $VERSION = '6.03';
sub new {
my ( $class, %opt ) = @_;
......@@ -49,7 +49,7 @@ monitor operated by Deutsche Bahn
=head1 VERSION
version 6.02
version 6.03
=head1 DESCRIPTION
......
......@@ -21,7 +21,7 @@ use Travel::Status::DE::HAFAS::Polyline qw(decode_polyline);
use Travel::Status::DE::HAFAS::Product;
use Travel::Status::DE::HAFAS::StopFinder;
our $VERSION = '6.02';
our $VERSION = '6.03';
# {{{ Endpoint Definition
......@@ -1225,7 +1225,7 @@ monitors
=head1 VERSION
version 6.02
version 6.03
=head1 DESCRIPTION
......
......@@ -11,13 +11,13 @@ use DateTime::Format::Strptime;
use List::Util qw(any uniq);
use Travel::Status::DE::HAFAS::Stop;
our $VERSION = '6.02';
our $VERSION = '6.03';
Travel::Status::DE::HAFAS::Journey->mk_ro_accessors(
qw(datetime sched_datetime rt_datetime tz_offset
is_additional is_cancelled is_partially_cancelled
station station_eva platform sched_platform rt_platform operator
product
product product_at
id name type type_long class number line line_no load delay
route_end route_start origin destination direction)
);
......@@ -368,6 +368,16 @@ sub route_interesting {
}
sub product_at {
my ( $self, $req_stop ) = @_;
for my $stop ( $self->route ) {
if ( $stop->loc->name eq $req_stop or $stop->loc->eva eq $req_stop ) {
return $stop->prod_dep // $stop->prod_arr;
}
}
return;
}
sub TO_JSON {
my ($self) = @_;
......@@ -419,7 +429,7 @@ journey received by Travel::Status::DE::HAFAS
=head1 VERSION
version 6.02
version 6.03
=head1 DESCRIPTION
......@@ -530,6 +540,12 @@ of transport, line number / ID, operator, ...) associated with this journey.
Note that journeys may be associated with multiple products -- see also
C<< $journey->route >> and C<< $stop->product >>.
=item $journey->product_at(I<stop>)
Travel::Status::DE::HAFAS::Product(3pm) instance describing the product
associated with I<stop> (name or EVA ID). Returns undef if product or I<stop>
are unknown.
=item $journey->rt_platform (station only)
Actual arrival/departure platform.
......
......@@ -6,7 +6,7 @@ use 5.014;
use parent 'Class::Accessor';
our $VERSION = '6.02';
our $VERSION = '6.03';
Travel::Status::DE::HAFAS::Location->mk_ro_accessors(
qw(lid type name eva state lat lon distance_m weight));
......@@ -57,7 +57,7 @@ Travel::Status::DE::HAFAS::Location - A single public transit location
=head1 VERSION
version 6.02
version 6.03
=head1 DESCRIPTION
......
......@@ -6,7 +6,7 @@ use 5.014;
use parent 'Class::Accessor';
our $VERSION = '6.02';
our $VERSION = '6.03';
Travel::Status::DE::HAFAS::Message->mk_ro_accessors(
qw(short type text code prio is_him ref_count));
......@@ -69,7 +69,7 @@ Travel::Status::DE::HAFAS::Message - An arrival/departure-related message.
=head1 VERSION
version 6.02
version 6.03
=head1 DESCRIPTION
......
......@@ -16,7 +16,7 @@ use 5.014;
use parent 'Exporter';
our @EXPORT_OK = qw(decode_polyline);
our $VERSION = '6.02';
our $VERSION = '6.03';
# Translated this php script
# <http://unitstep.net/blog/2008/08/02/decoding-google-maps-encoded-polylines-using-php/>
......
......@@ -8,7 +8,7 @@ use 5.014;
use parent 'Class::Accessor';
our $VERSION = '6.02';
our $VERSION = '6.03';
Travel::Status::DE::HAFAS::Product->mk_ro_accessors(
qw(class line_id line_no name number type type_long operator));
......@@ -105,7 +105,7 @@ associated with a journey.
=head1 VERSION
version 6.02
version 6.03
=head1 DESCRIPTION
......
......@@ -8,7 +8,7 @@ use 5.014;
use parent 'Class::Accessor';
our $VERSION = '6.02';
our $VERSION = '6.03';
Travel::Status::DE::HAFAS::Stop->mk_ro_accessors(
qw(loc
......@@ -218,7 +218,7 @@ Travel::Status::DE::HAFAS::Stop - Information about a HAFAS stop.
=head1 VERSION
version 6.02
version 6.03
=head1 DESCRIPTION
......
......@@ -10,7 +10,7 @@ use Encode qw(decode);
use JSON;
use LWP::UserAgent;
our $VERSION = '6.02';
our $VERSION = '6.03';
# {{{ Constructors
......@@ -180,7 +180,7 @@ finder services
=head1 VERSION
version 6.02
version 6.03
=head1 DESCRIPTION
......