From 8f9e10bfdae42f3b09a80b3a17ebc53a07bfbc74 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 9 Apr 2016 15:48:42 +0200 Subject: document line_id, stop_id and via_id --- lib/Travel/Status/DE/URA.pm | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) (limited to 'lib/Travel/Status/DE/URA.pm') diff --git a/lib/Travel/Status/DE/URA.pm b/lib/Travel/Status/DE/URA.pm index afa62d8..3deba04 100644 --- a/lib/Travel/Status/DE/URA.pm +++ b/lib/Travel/Status/DE/URA.pm @@ -201,6 +201,8 @@ sub results { my $via = $opt{via} // $self->{via}; my $via_id = $opt{via_id} // $self->{via_id}; + my $line_id = $self->{line_id}; + my $dt_now = $self->{datetime}; my $ts_now = $dt_now->epoch; @@ -222,6 +224,10 @@ sub results { next; } + if ( $line_id and not( $lineid eq $line_id ) ) { + next; + } + if ( $stop and not( $stopname eq $stop ) ) { next; } @@ -392,7 +398,7 @@ The request URL is I/instant_VI, so for C<< http://ivu.aseag.de/interfaces/ura >>, C<< 1 >> this module will send requests to C<< http://ivu.aseag.de/interfaces/ura/instant_V1 >>. -The following parameter is optional: +All remaining parameters are optional. =over @@ -401,6 +407,10 @@ The following parameter is optional: Passed on to C<< LWP::UserAgent->new >>. Defaults to C<< { timeout => 10 } >>, you can use an empty hashref to override it. +=item B => I + +TODO + =back Additionally, all options supported by C<< $status->results >> may be specified @@ -420,6 +430,12 @@ Returns a list of stops matching I<$stopname>. For instance, if the stops parameter "bushof" will return "Aachen Bushof" and "Eupen Bushof", while "brand" will only return "Brand". +=item $status->get_stops + +Returns a hash reference describing all distinct stops returned by the request. +Each key is the unique ID of a stop and contains a +Travel::Status::DE::URA::Stop(3pm) object describing it. + =item $status->results(I<%opt>) Returns a list of Travel::Status::DE::URA::Result(3pm) objects, each describing @@ -427,11 +443,6 @@ one departure. Accepted parameters (all are optional): -=item $status->get_stops() - -Returns a list of all Stops returned by the Request. -This is usefull for circle requests, to find nearby Stops. - =over =item B => I (default 0) @@ -444,15 +455,28 @@ their B accessors. Otherwise, those will just return nothing Do not include past departures in the result list and the computed timetables. +=item B => I + +Only return departures of line I. + =item B => I Only return departures at stop I. +=item B => I + +Only return departures at stop I. + =item B => I Only return departures containing I in their route after their corresponding stop. Implies B=1. +=item B => I + +Only return departures containing I in their route after their +corresponding stop. Implies B=1. + =back =back -- cgit v1.2.3