From 5b388937648aa4aa6696020798d06601b91c2648 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 19 Jan 2019 23:25:26 +0100 Subject: Document Travel::StatuS::DE::DBWagenreihung --- lib/Travel/Status/DE/DBWagenreihung.pm | 169 +++++++++++++++++++++++++++++++++ 1 file changed, 169 insertions(+) diff --git a/lib/Travel/Status/DE/DBWagenreihung.pm b/lib/Travel/Status/DE/DBWagenreihung.pm index 1f3c440..ba5fe59 100644 --- a/lib/Travel/Status/DE/DBWagenreihung.pm +++ b/lib/Travel/Status/DE/DBWagenreihung.pm @@ -369,3 +369,172 @@ sub get_with_cache { } 1; + +__END__ + +=head1 NAME + +Travel::Status::DE::DBWagenreihung - Interface to Deutsche Bahn Wagon Order API. + +=head1 SYNOPSIS + + use Travel::Status::DE::DBWagenreihung; + + my $wr = Travel::Status::DE::DBWagenreihung->new( + departure => 'DateTime or YYYYMMDDhhmm', + train_number => 1234, + ); + + for my $wagon ( $wr->wagons ) { + printf("Wagen %s: Abschnitt %s\n", $wagon->number // '?', $wagon->section); + } + +=head1 VERSION + +version 0.00 + +=head1 DESCRIPTION + +Travel:Status:DE::DBWagenreihung is an unofficial interface to the Deutsche +Bahn Wagon Order API at L. It +returns station-specific wagon orders for long-distance trains operated by +Deutsche Bahn. Data includes wagon positions on the platform, the ICE series, +wagon-specific attributes such as first/second class or family coaches, and the +internal type and number of each wagon. + +Positions on the platform are given both in meters and per cent (relative to +platform length). + +At the time of this writing, only ICE trains are officially supported by the +backend, and even then glitches may occur. IC/EC trains are not officially +supported; reported wagon orders may be correct, may lack unscheduled changes, +or may be completely bogus. + +=head1 METHODS + +=over + +=item my $wr = Travel::Status::DE::DBWagenreihung->new(I<%opts>) + +Requests wagon order for a specific train at a specific scheduled departure +time and date, which implicitly encodes the requested station. Use +L or similar to map station name and train number +to scheduled departure. + +Arguments: + +=over + +=item B => I | I + +Scheduled departure at the station of interested. Must be either a +L object or a string in YYYYMMDDhhmm format. Mandatory. + +=item B => I + +Train number. Do not include the train type: Use "8" for "EC 8" or +"100" for "ICE 100". + +=back + +=item $wr->destinations + +Returns a list describing all final destinations of this train. In most +cases, it contains one element, however, for trains consisting of multiple +wings, it contains one element for each wing. + +Each destination is a hash ref containing the destination B and the +corresponding platform I (at the moment, this is a list of section +identifiers). + +This function is subject to change. + +=item $wr->direction + +Gives the train's direction of travel. Returns 0 if the train will depart +towards position 0 and 100 if the train will depart towards the other platform +end (mnemonic: towards the 100% position). + +=item $wr->error + +In case of a fatal HTTP or backend error, returns a string describing it. +Returns undef otherwise. + +=item $wr->origins + +Returns a list of stations this train originates from. In most cases, this is +just one element; however, for trains consisting of multiple wings, it gives +the origin of each wing unless they are identical. + +Each origin is a station name. + +This function is subject to change. + +=item $wr->platform + +Returns the platform name. + +=item $wr->sections + +Describes the sections of the platform this train will depart from. +Returns a list of L objects. + +=item $wr->station_ds100 + +Returns the DS100 identifier of the requested station. + +=item $wr->station_name + +Returns the name of the requested station. + +=item $wr->station_uic + +Returns the international id (UIC ID / IBNR) of the requested station. + +=item $wr->train_numbers + +Returns the list of train numbers for this departure. In most cases, this is +just one element. For trains consisting of multiple wings (which typically have +different numbers), it contains one element for each wing. + +=item $wr->train_type + +Returns a string describing the train type, e.g. "ICE" or "IC". + +=item $wr->train_subtype + +Returns a string describing the rolling stock used for this train, e.g. "ICE 4" +or "IC2". + +=item $wr->wagons + +Describes the individual wagons the train consists of. Returns a list of +L objects. + +=back + +=head1 DEPENDENCIES + +=over + +=item * L + +=item * L + +=back + +=head1 BUGS AND LIMITATIONS + +Many. This is beta software. + +=head1 REPOSITORY + +L + +=head1 AUTHOR + +Copyright (C) 2018-2019 by Daniel Friesel Ederf@finalrewind.orgE + +=head1 LICENSE + +This module is licensed under the same terms as Perl itself. -- cgit v1.2.3