Daniel Friesel > Travel-Status-DE-DeutscheBahn > Travel::Status::DE::DeutscheBahn::Result

Download:
Travel-Status-DE-DeutscheBahn-1.02.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 1.02   Source  

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->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 1.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->date

Arrival/Departure date in "dd.mm.yyyy" format.

$result->delay

Returns the train's delay in minutes, or undef if it is unknown.

$result->info

Returns additional information, for instance the reason why the train is delayed. May be an empty string if no (useful) information is available.

$result->line
$result->train

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

$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_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->route_interesting([max])

Returns a list of up to max (default: 3) interesting stations the train will pass on its journey. Since deciding whether a station is interesting or not is somewhat tricky, this feature should be considered experimental.

The first element of the list is always the train's next stop. The following elements contain as many main stations as possible, but there may also be smaller stations if not enough main stations are available.

In future versions, other factors may be taken into account as well. For example, right now airport stations are usually not included in this list, although they should be.

Note that all main stations will be stripped of their "Hbf" suffix.

$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->route_timetable

Similar to route. however, this function returns a list of array references of the form [ arrival time, station name ].

$result->time

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

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_raw => string

DIAGNOSTICS ^

None.

DEPENDENCIES ^

Class::Accessor(3pm)

BUGS AND LIMITATIONS ^

None known.

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.

syntax highlighting: