NAME
Travel::Status::DE::HAFAS::Result - Information about a single arrival/departure received by Travel::Status::DE::HAFAS
SYNOPSIS
for my $departure ($status->results) {
printf(
"At %s: %s to %s from platform %s\n",
$departure->time,
$departure->line,
$departure->destination,
$departure->platform,
);
}
# or (depending on module setup)
for my $arrival ($status->results) {
printf(
"At %s: %s from %s on platform %s\n",
$arrival->time,
$arrival->line,
$arrival->origin,
$arrival->platform,
);
}
VERSION
version 2.03
DESCRIPTION
Travel::Status::DE::HAFAS::Result describes a single arrival/departure as obtained by Travel::Status::DE::HAFAS. It contains information about the platform, time, route and more.
METHODS
ACCESSORS
- $result->countdown
-
Difference between the time Travel::Status::DE::HAFAS->results was called first and the arrival/departure time, in minutes.
- $result->countdown_sec
-
Difference between the time Travel::Status::DE::HAFAS->results was called first and the arrival/departure time, in seconds.
- $result->date
-
Arrival/Departure date in "dd.mm.yyyy" format.
- $result->datetime
-
DateTime object holding the arrival/departure date and time.
- $result->delay
-
Returns the delay in minutes, or undef if it is unknown. Also returns undef if the arrival/departure has been cancelled.
- $result->info
-
Returns additional information, for instance the most recent delay reason. undef if no (useful) information is available.
- $result->is_cancelled
-
True if the arrival/departure was cancelled, false otherwise.
- $result->is_changed_platform
-
True if the platform (as returned by the platform accessor) is not the scheduled one. Note that the scheduled platform is unknown in this case.
- $result->messages
-
Returns a list of message strings related to this result. Messages usually are service notices (e.g. "missing carriage") or detailed delay reasons (e.g. "switch damage between X and Y, expect delays").
- $result->line
- $result->train
-
Returns the line name, either in a format like "Bus SB16" (Bus line SB16) or "RE 10111" (RegionalExpress train 10111, no line information). May contain extraneous whitespace characters.
- $result->line_no
- $result->train_no
-
Returns the line/train number, for instance "SB16" (bus line SB16), "11" (Underground train line U 11) or 1011 ("RegionalExpress train 1011"). Note that this may not be a number at all: Some transport services also use single-letter characters or words (e.g. "AIR") as line numbers.
- $result->platform
-
Returns the arrival/departure platform. Realtime data if available, schedule data otherwise.
- $result->route_end
- $result->destination
- $result->origin
-
Returns the last element of the route. Depending on how you set up Travel::Status::DE::HAFAS (arrival or departure listing), this is either the result's destination or its origin station.
- $result->time
-
Returns the arrival/departure time as string in "hh:mm" format.
- $result->type
-
Returns the type of this result, e.g. "S" for S-Bahn, "RE" for Regional Express or "STR" for tram / Straßenbahn.
DIAGNOSTICS
None.
DEPENDENCIES
BUGS AND LIMITATIONS
None known.
SEE ALSO
Travel::Status::DE::HAFAS(3pm).
AUTHOR
Copyright (C) 2015-2017 by Daniel Friesel <derf@finalrewind.org>
LICENSE
This module is licensed under the same terms as Perl itself.