From 9aa1eab9c3fca4713ae67acab23d9b65e96ace9b Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 29 Nov 2011 15:06:59 +0100 Subject: documentation --- lib/Travel/Routing/DE/VRR/Route.pm | 25 ++++++++-- lib/Travel/Routing/DE/VRR/Route/Part.pm | 84 ++++++++++++++++++++++----------- 2 files changed, 77 insertions(+), 32 deletions(-) (limited to 'lib/Travel/Routing') diff --git a/lib/Travel/Routing/DE/VRR/Route.pm b/lib/Travel/Routing/DE/VRR/Route.pm index d2c85e7..04228a2 100644 --- a/lib/Travel/Routing/DE/VRR/Route.pm +++ b/lib/Travel/Routing/DE/VRR/Route.pm @@ -65,17 +65,34 @@ You usually want to acces it via C<< $efa->routes >>. =head1 METHODS +=head2 ACCESSORS + =over -=item my $route = Travel::Routing::DE::VRR::Route->new(I<@parts>) +=item $route->duration -Creates a new Travel::Routing::DE::VRR::Route elements consisting of I, -which are Travel::Routing::DE::VRR::Route::Part elements. +route duration as string in HH:MM format =item $route->parts Returns a list of Travel::Routing::DE::VRR::Route::Part(3pm) elements describing -the actual route. +the actual route + +=item $route->ticket_type + +Type of the required ticket for this route, if available (empty string otherwise) + +=item $route->fare_adult + +ticket price for an adult in EUR + +=item $route->fare_child + +ticket price for a child in EUR + +=item $route->vehicle_time + +on-vehicle time (excluding waiting time) of the route in minutes =back diff --git a/lib/Travel/Routing/DE/VRR/Route/Part.pm b/lib/Travel/Routing/DE/VRR/Route/Part.pm index e31e713..5122868 100644 --- a/lib/Travel/Routing/DE/VRR/Route/Part.pm +++ b/lib/Travel/Routing/DE/VRR/Route/Part.pm @@ -84,57 +84,85 @@ B method. =head1 METHODS +=head2 ACCESSORS + +"Actual" in the description means that the delay (if available) is already +included in the calculation, "Scheduled" means it isn't. + =over -=item $part = Travel::Routing::DE::VRR::Route::Part->new(I<%data>) +=item $part->arrival_stop -Creates a new Travel::Routing::DE::VRR::Route::Part object. I consists of: +arrival stop (city name plus station name) -=over +=item $part->arrival_platform -=item B => I:I +arrival platform (either "Gleis x" or "Bstg. x") -Arrival time +=item $part->arrival_stop_and_platform -=item B => I +"stop: platform" concatenation -Arrival stop (city plus station / address) +=item $part->arrival_date -=item B => I +Actual arrival date in DD.MM.YYYY format -Departure time +=item $part->arrival_time -=item B => I +Actual arrival time in HH:MM format -Departure stop (city plus station / address) +=item $part->arrival_sdate -=item B => I +Scheduled arrival date in DD.MM.YYYY format -Destination of the train connecting the stops +=item $part->arrival_stime -=item B => I +Scheduled arrival time in HH:MM format -The train's line name. +=item $part->delay -=item B => B<[> [ I, [ I [ I<...> ] ] ] B<]> +delay in minutes, 0 if unknown -Additional information about this connection. Array-ref of newline-terminated -strings. +=item $part->departure_stop -=back +departure stop (city name plus station name) + +=item $part->departure_platform + +departure platform (either "Gleis x" or "Bstg. x") + +=item $part->departure_stop_and_platform + +"stop: platform" concatenation + +=item $part->departure_date + +Actual departure date in DD.MM.YYYY format + +=item $part->departure_time + +Actual departure time in HH:MM format + +=item $part->departure_sdate + +Scheduled departure date in DD.MM.YYYY format + +=item $part->departure_stime + +Scheduled departure time in HH:MM format + +=item $part->extra -=item $part->get(I) +Additional information about the connection. Returns a list of +newline-terminated strings -Returns the value of I (B, B etc., see -B). +=item $part->train_destination -Each of these I also has an accessor. So C<< $part->departure_time() >> -is the same as C<< $part->get('departure_time') >>. +destination of the line providing the connection -=item $part->extra() +=item $part->train_line -Returns a list of additional information about this route part, if provided. -Returns an empty list otherwise. +name / number of the line =back @@ -156,7 +184,7 @@ None known. =head1 SEE ALSO -Travel::Routing::DE::VRR(3pm). +Travel::Routing::DE::VRR(3pm), Class::Accessor(3pm). =head1 AUTHOR -- cgit v1.2.3