The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

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.09

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 either departure on time or that no delay 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->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 also may have the same numbers.

$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-2014 by Daniel Friesel <derf@finalrewind.org>

LICENSE

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