NAME
Travel::Routing::DE::VRR::Route::Part - Describes one connection between two points, without interchanges
SYNOPSIS
for my $part ( $route->parts ) {
if ( $part->extra ) {
say join( "\n", $part->extra );
}
printf(
"%s at %s -> %s at %s, via %s to %s",
$part->departure_time, $part->departure_stop,
$part->arrival_time, $part->arrival_stop,
$part->train_line, $part->train_destination,
);
}
VERSION
version 1.05
DESCRIPTION
Travel::Routing::DE::VRR::Route::Part holds one specific connection (without interchanges) between two points. It specifies the start/stop point and time, the train line and its destination, and optional additional data.
It is usually obtained by a call to Travel::Routing::DE::VRR::Route(3pm)'s parts method.
METHODS
- $part = Travel::Routing::DE::VRR::Route::Part->new(%data)
-
Creates a new Travel::Routing::DE::VRR::Route::Part object. data consists of:
- arrival_time => HH:MM
-
Arrival time
- arrival_stop => name
-
Arrival stop (city plus station / address)
- departure_time => HH:MM
-
Departure time
- departure_stop => name
-
Departure stop (city plus station / address)
- train_destination => name
-
Destination of the train connecting the stops
- train_line => name
-
The train's line name.
- extra => [ [ line1, [ line2 [ ... ] ] ] ]
-
Additional information about this connection. Array-ref of newline-terminated strings.
- $part->get(name)
-
Returns the value of name (arrival_time, arrival_stop etc., see new).
Each of these names also has an accessor. So
$part->departure_time()
is the same as$part->get('departure_time')
. - $part->extra()
-
Returns a list of additional information about this route part, if provided. Returns an empty list otherwise.
DIAGNOSTICS
None.
DEPENDENCIES
Class::Accessor(3pm)
BUGS AND LIMITATIONS
None known.
SEE ALSO
Travel::Routing::DE::VRR(3pm).
AUTHOR
Copyright (C) 2011 by Daniel Friesel <derf@finalrewind.org>
LICENSE
0. You just DO WHAT THE FUCK YOU WANT TO.