NAME

Travel::Status::DE::EFA::Result - Information about a single departure received by Travel::Status::DE::EFA

SYNOPSIS

    for my $departure ($status->results) {
        printf(
            "At %s: %s to %s from platform %d\n",
            $departure->time, $departure->line, $departure->destination,
            $departure->platform
        );
    }

VERSION

version 1.14

DESCRIPTION

Travel::Status::DE::EFA::Result describes a single departure as obtained by Travel::Status::DE::EFA. It contains information about the time, platform, line number and destination.

METHODS

ACCESSORS

"Actual" in the description means that the delay (if available) is already included in the calculation, "Scheduled" means it isn't.

$departure->countdown

Actual time in minutes from now until the tram/bus/train will depart.

If delay information is available, it is already included.

$departure->date

Actual departure date (DD.MM.YYYY).

$departure->delay

Expected delay from scheduled departure time in minutes. A delay of 0 indicates departure on time. undef when no realtime information is available.

$departure->destination

Destination name.

$departure->info

Additional information related to the departure (string). If departures for an address were requested, this is the stop name, otherwise it may be recent news related to the line's schedule. If no information is available, returns an empty string.

$departure->is_cancelled

1 if the departure got cancelled, 0 otherwise.

$departure->key

Unknown. Unlike the name may suggest, this is not a unique key / UUID for a departure: On the same day, different lines departing at the same station may have the same key. It might, however, be unique when combined with the line information.

$departure->line

The name/number of the line.

$departure->lineref

Travel::Status::DE::EFA::Line(3pm) object describing the departing line in detail.

$departure->mot

Returns the "mode of transport" number. This is usually an integer between 0 and 11.

$departure->mot_name

Returns the "mode of transport", for instance "zug", "s-bahn", "tram" or "sonstige".

$departure->platform

Departure platform number (may not be a number).

$departure->platform_db

true if the platform number is operated by DB ("Gleis x"), false ("Bstg. x") otherwise.

Unfortunately, there is no distinction between tram and bus platforms yet, which may also have the same numbers.

$departure->route_interesting

List of up to three "interesting" stations served by this departure. Is a subset of route_post. Each station is a Travel::Status::DE::EFA::Stop(3pm) object.

$departure->route_pre

List of stations the train passed (or will have passed) befoe this stop. Each station is a Travel::Status::DE::EFA::Stop(3pm) object.

$departure->route_post

List of stations the train will pass after this stop. Each station is a Travel::Status::DE::EFA::Stop(3pm) object.

$departure->sched_date

Scheduled departure date (DD.MM.YYYY).

$departure->sched_time

Scheduled departure time (HH:MM).

$departure->time

Actual departure time (HH:MM).

$departure->type

Type of the departure. Note that efa.vrr.de sometimes puts bogus data in this field. See DEPARTURE TYPES.

INTERNAL

$departure = Travel::Status::DE::EFA::Result->new(%data)

Returns a new Travel::Status::DE::EFA::Result object. You should not need to call this.

$departure->TO_JSON

Allows the object data to be serialized to JSON.

DEPARTURE TYPES

The following are known so far:

* Abellio-Zug
* Bus
* Eurocity
* Intercity-Express
* NE (NachtExpress / night bus)
* Niederflurbus
* R-Bahn (RE / RegionalExpress)
* S-Bahn
* SB (Schnellbus)
* Straßenbahn
* U-Bahn

DIAGNOSTICS

None.

DEPENDENCIES

Class::Accessor(3pm)

BUGS AND LIMITATIONS

$result->type may contain bogus data. This comes from the efa.vrr.de interface.

SEE ALSO

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

AUTHOR

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

LICENSE

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