From 57c364c44bc177569ded124c4b710f052942e943 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 10 Jan 2014 21:56:26 +0100 Subject: db-iris: Add -c / --class option, rename -m/--mot to -T/--type --- lib/Travel/Status/DE/IRIS.pm | 2 +- lib/Travel/Status/DE/IRIS/Result.pm | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) (limited to 'lib/Travel/Status') diff --git a/lib/Travel/Status/DE/IRIS.pm b/lib/Travel/Status/DE/IRIS.pm index 203c9bf..81c6797 100644 --- a/lib/Travel/Status/DE/IRIS.pm +++ b/lib/Travel/Status/DE/IRIS.pm @@ -88,7 +88,7 @@ sub add_result { my %data = ( raw_id => $id, - class => $e_tl->getAttribute('f'), # D N S F + classes => $e_tl->getAttribute('f'), # D N S F unknown_t => $e_tl->getAttribute('t'), # p train_no => $e_tl->getAttribute('n'), # dep number type => $e_tl->getAttribute('c'), # S/ICE/ERB/... diff --git a/lib/Travel/Status/DE/IRIS/Result.pm b/lib/Travel/Status/DE/IRIS/Result.pm index 016393d..4eb3096 100644 --- a/lib/Travel/Status/DE/IRIS/Result.pm +++ b/lib/Travel/Status/DE/IRIS/Result.pm @@ -16,10 +16,10 @@ use List::MoreUtils qw(uniq); our $VERSION = '0.00'; Travel::Status::DE::IRIS::Result->mk_ro_accessors( - qw(arrival date datetime delay departure is_cancelled line_no platform raw_id - realtime_xml route_start route_end - sched_arrival sched_departure sched_route_start sched_route_end - start stop_no time train_id train_no type unknown_t unknown_o) + qw(arrival classes date datetime delay departure is_cancelled line_no + platform raw_id realtime_xml route_start route_end sched_arrival + sched_departure sched_route_start sched_route_end start stop_no time + train_id train_no type unknown_t unknown_o) ); sub new { @@ -398,6 +398,18 @@ the platform, time, route and more. DateTime(3pm) object for the arrival date and time. undef if the train starts here. Contains realtime data if available. +=item $result->classes + +List of characters indicating the class(es) of this train, may be empty. This +is slighty related to B, but more generic. At this time, the following +classes are known: + + D Non-DB train. Usually local transport + D,F Non-DB train, long distance transport + F "Fernverkehr", long-distance transport + N "Nahverkehr", local and regional transport + S S-Bahn, rather slow local/regional transport + =item $result->date Scheduled departure date if available, arrival date otherwise (e.g. if the -- cgit v1.2.3