The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

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

SYNOPSIS

    for my $departure ($status->results) {
        printf(
            "At %s: %s to %s (in %d minutes)",
            $departure->time, $departure->line, $departure->destination,
            $departure->countdown
        );
    }

VERSION

version 2.01

DESCRIPTION

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

METHODS

ACCESSORS

$departure->countdown

Time in minutes from the time Travel::Status::DE::URA was instantiated until the bus will depart.

$departure->countdown_sec

Time in seconds from the time Travel::Status::DE::URA was instantiated until the bus will depart.

$departure->date

Departure date (DD.MM.YYYY)

$departure->datetime

DateTime object holding the departure date and time.

$departure->destination

Destination name.

$departure->line

The name of the line.

$departure->line_id

The number of the line.

$departure->platform

Shortcut for $departure->stop_indicator, see there.

$departure->route_interesting(num_stops)

If the results method of Travel::Status::DE::URA(3pm) was called with calculate_routes => true: Returns a list of up to num_stops (defaults to 3) stops considered interesting (usually of major importance in the transit area). Each stop is a Travel::Status::DE::URA::Stop(3pm) object. Note that the importance is determined heuristically based on the stop name, so it is not always accurate.

Returns an empty list if calculate_routes was false.

$departure->route_pre

If the results method of Travel::Status::DE::URA(3pm) was called with calculate_routes => true: Returns a list containing all stops after the requested one. Each stop is a Travel::Status::DE::URA::Stop(3pm) object. Returns an empty list otherwise.

$departure->route_post

Same as route_pre, but contains the stops before the requested one.

$departure->stop

The stop (name, not object) belonging to this departure.

$departure->stop_id

The stop ID belonging to this departure.

$departure->stop_indicator

The indicator for this departure at the corresponding stop, usually describes a platform or sub-stop number. undef if the stop does not have such a distinction.

$departure->time

Departure time (HH:MM:SS).

$departure->type

Vehicle type for this departure. At the moment, this always returns "Bus". This option exists for compatibility with other Travel::Status libraries.

INTERNAL

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

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

$departure->TO_JSON

Allows the object data to be serialized to JSON.

DIAGNOSTICS

None.

DEPENDENCIES

Class::Accessor(3pm)

BUGS AND LIMITATIONS

Unknown.

SEE ALSO

Travel::Status::DE::URA(3pm), Travel::Status::DE::URA::Stop(3pm).

AUTHOR

Copyright (C) 2013-2016 by Daniel Friesel <derf@finalrewind.org>

LICENSE

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