summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2022-10-29 10:44:55 +0200
committerDaniel Friesel <derf@finalrewind.org>2022-10-29 10:44:55 +0200
commit5b9aa75d735b4ad27ea099cb8589360b62c31980 (patch)
tree5d97ea717f7b5f5825663fbe463131ed2ab5c8fc /lib/Travel/Status/DE
parent7ed6a265b747a275c24dce2797445d9c789124f2 (diff)
Journey: add class accessor
Diffstat (limited to 'lib/Travel/Status/DE')
-rw-r--r--lib/Travel/Status/DE/HAFAS/Journey.pm11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/Travel/Status/DE/HAFAS/Journey.pm b/lib/Travel/Status/DE/HAFAS/Journey.pm
index fba55cd..796afc5 100644
--- a/lib/Travel/Status/DE/HAFAS/Journey.pm
+++ b/lib/Travel/Status/DE/HAFAS/Journey.pm
@@ -16,7 +16,7 @@ Travel::Status::DE::HAFAS::Journey->mk_ro_accessors(
qw(datetime sched_datetime rt_datetime
is_cancelled is_partially_cancelled
platform sched_platform rt_platform operator
- id name type type_long number line load delay
+ id name type type_long class number line load delay
route_end route_start origin destination direction)
);
@@ -86,6 +86,8 @@ sub new {
}
}
+ my $class = $product->{cls};
+
my @stops;
for my $stop ( @{ $journey->{stopL} // [] } ) {
my $loc = $locL[ $stop->{locX} ];
@@ -169,6 +171,7 @@ sub new {
line => $line_no,
type => $cat,
type_long => $catlong,
+ class => $class,
operator => $operator,
direction => $direction,
is_cancelled => $is_cancelled,
@@ -379,6 +382,12 @@ or "STR" for tram / StraE<szlig>enbahn.
Returns the long type of this journey, e.g. "S-Bahn" or "Regional-Express".
+=item $journey->class
+
+Returns an integer identifying the the mode of transport class.
+Semantics depend on backend, e.g. "1" and "2" for long-distance trains and
+"4" and "8" for region trains.
+
=item $journey->line
Returns the line identifier, or undef if it is unknown.