NAME

Travel::Status::DE::DeutscheBahn::Result - Information about a single arrival/departure received by Travel::Status::DE::DeutscheBahn

SYNOPSIS

for my $departure ($status->results) {
	printf(
		"At %s: %s to %s from platform %s\n",
		$departure->time,
		$departure->train,
		$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->train,
		$arrival->origin,
		$arrival->platform,
	);
}

VERSION

version 0.02

DESCRIPTION

Travel::Status::DE::DeutscheBahn::Result describes a single arrival/departure as obtained by Travel::Status::DE::DeutscheBahn. It contains information about the platform, time, route and more.

METHODS

ACCESSORS

$result->route_end

Returns the last element of the route. Depending on how you set up Travel::Status::DE::DeutscheBahn (arrival or departure listing), this is either the train's destination or its origin station.

$result->destination
$result->origin

Convenience aliases for $result->route_end.

$result->info

Returns additional information, usually wether the train is on time or delayed.

$result->platform

Returns the platform from which the train will depart / at which it will arrive.

$result->route

Returns a list of station names the train will pass between the selected station and its origin/destination.

$result->route_raw

Returns the raw string used to create the route array.

Note that canceled stops are filtered from route, but still present in route_raw.

$result->time

Returns the arrival/departure time as string in "hh:mm" format.

$result->train

Returns the line / train name, either in a format like "S 1" (S-Bahn line 1) or "RE 10111" (RegionalExpress train 10111, no line information).

INTERNAL

$result = Travel::Status::DE::DeutscheBahn::Result->new(%data)

Returns a new Travel::Status::DE::DeutscheBahn::Result object. You usually do not need to call this.

Required data:

time => hh:mm
train => string
route_raw => string
route => arrayref
route_end => string
platform => string
info => string

DIAGNOSTICS

None.

DEPENDENCIES

Class::Accessor(3pm)

BUGS AND LIMITATIONS

Unknown.

SEE ALSO

Travel::Status::DE::DeutscheBahn(3pm).

AUTHOR

Copyright (C) 2011 by Daniel Friesel <derf@finalrewind.org>

LICENSE

This module is licensed under the same terms as Perl itself.