From 73f33c43170032b8b278ffd8622faac3253219e3 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Thu, 9 Jan 2014 22:52:58 +0100 Subject: complete IRIS.pm documentation --- lib/Travel/Status/DE/IRIS.pm | 87 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 84 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/Travel/Status/DE/IRIS.pm b/lib/Travel/Status/DE/IRIS.pm index 02299fe..e496f88 100644 --- a/lib/Travel/Status/DE/IRIS.pm +++ b/lib/Travel/Status/DE/IRIS.pm @@ -249,7 +249,20 @@ Travel::Status::DE::IRIS - Interface to IRIS based web departure monitors. =head1 SYNOPSIS -TODO + use Travel::Status::DE::IRIS; + use Travel::Status::DE::IRIS::Stations; + + # Get station code for "Essen Hbf" (-> "EE") + my $station = (Travel::Status::DE::IRIS::Stations::get_station_by_name( + 'Essen Hbf'))[0][0]; + + my $status = Travel::Status::DE::IRIS->new(station => $station); + for my $r ($status->results) { + printf( + "%s %s +%-3d %10s -> %s\n", + $r->date, $r->time, $r->delay || 0, $r->line, $r->destination + ); + } =head1 VERSION @@ -257,13 +270,81 @@ version 0.00 =head1 DESCRIPTION -TraveL::Status::DE::IRIS is an unofficial interface to IRIS based web +Travel::Status::DE::IRIS is an unofficial interface to IRIS based web departure monitors such as L. +=head1 METHODS + +=over + +=item my $states = Travel::Status::DE::IRIS->new(I<%opt>) + +Requests schedule and realtime data for a specific station at a specific +point in time. Returns a new Travel::Status::DE::IRIS object. + +Arguments: + +=over + +=item B => I + +A DateTime(3pm) object specifying the point in time. Optional, defaults to the +current date and time. + +=item B => I + +Mandatory: Which station to return departures for. Note that this is not a +station name, but a station code, such as "EE" (for Essen Hbf) or "KA" +(for Aachen Hbf). See Travel::Status::DE::IRIS::Stations(3pm) for a +name to code mapping. + +=back + +All other options are passed to the LWP::UserAgent(3pm) constructor. + +=item $status->errstr + +In case of an HTTP request or IRIS error, returns a string describing it. +Returns undef otherwise. + +=item $status->results + +Returns a list of Travel::Status::DE::IRIS(3pm) objects, each one describing +one arrival and/or departure. + +=back + +=head1 DIAGNOSTICS + +None. + +=head1 DEPENDENCIES + +=over + +=item * DateTime(3pm) + +=item * List::Util(3pm) + +=item * LWP::UserAgent(3pm) + +=item * XML::LibXML(3pm) + +=back + +=head1 BUGS AND LIMITATIONS + +Many backend features are not yet exposed. + +=head1 SEE ALSO + +db-iris(1), Travel::Status::DE::IRIS::Result(3pm), +Travel::Status::DE::IRIS::Stations(3pm) + =head1 AUTHOR -Copyright (C) 2013 by Daniel Friesel Ederf@finalrewind.orgE +Copyright (C) 2013-2014 by Daniel Friesel Ederf@finalrewind.orgE =head1 LICENSE -- cgit v1.2.3