summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-09-09 17:31:11 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-09-09 17:31:11 +0200
commit17608f3e323309cb4ca8919be73e785ebcf0bec5 (patch)
treeec474f455430d04c3964f72bbe50c9c63adb0d05
parent426806be46efedc8f252c1830cf0c02d79c14304 (diff)
More documentation
-rw-r--r--Build.PL4
-rw-r--r--lib/Travel/Status/DE/VRR.pm57
-rw-r--r--lib/Travel/Status/DE/VRR/Result.pm52
3 files changed, 110 insertions, 3 deletions
diff --git a/Build.PL b/Build.PL
index 05433cb..af48452 100644
--- a/Build.PL
+++ b/Build.PL
@@ -11,12 +11,12 @@ Module::Build->new(
'Test::Pod' => 0,
},
module_name => 'Travel::Status::DE::VRR',
- license => 'unrestricted',
+ license => 'perl',
requires => {
'perl' => '5.10.1',
'Class::Accessor' => 0,
'Getopt::Long' => 0,
- 'List::Utel' => 0,
+ 'List::Util' => 0,
'WWW::Mechanize' => 0,
'XML::LibXML' => 0,
},
diff --git a/lib/Travel/Status/DE/VRR.pm b/lib/Travel/Status/DE/VRR.pm
index 2a38eae..cbb1262 100644
--- a/lib/Travel/Status/DE/VRR.pm
+++ b/lib/Travel/Status/DE/VRR.pm
@@ -121,30 +121,85 @@ Travel::Status::DE::VRR - inofficial VRR departure monitor
=head1 SYNOPSIS
+ use Travel::Status::DE::VRR;
+
+ my $status = Travel::Status::DE::VRR->new(
+ place => 'Essen', name => 'Helenenstr'
+ );
+
+ for my $d ($status->results) {
+ printf(
+ "%s %-8s %-5s %s\n",
+ $d->time, $d->platform, $d->line, $d->destination
+ );
+ }
+
=head1 VERSION
-version
+version 0.00
=head1 DESCRIPTION
+Travel::Status::DE::VRR is an inofficial interface to the VRR departure
+monitor available at
+L<http://efa.vrr.de/vrr/XSLT_DM_REQUEST?language=de&itdLPxx_transpCompany=vrr&>.
+
+It shows all upcoming tram/bus/train departures at a given stop.
+
=head1 METHODS
=over
+=item my $status = Travel::Status::DE::VRR->new(I<%opt>)
+
+Returns a new Travel::Status::DE::VRR object. Dies if the request failed.
+
+Arguments:
+
+=over
+
+=item B<place> => I<place>
+
+Name of the place/city
+
+=item B<name> => I<stop name>
+
+Name of the stop to list departures for. In future versions, this may also
+support street or poi ("point of interest") names
+
+=back
+
+=item $status->results
+
+Returns a list of Travel::Status::DE::VRR::Result(3pm) objects, each one describing
+one departure.
+
=back
=head1 DIAGNOSTICS
+None.
+
=head1 DEPENDENCIES
=over
+=item * Class::Accessor(3pm)
+
+=item * WWW::Mechanize(3pm)
+
+=item * XML::LibXML(3pm)
+
=back
=head1 BUGS AND LIMITATIONS
+Not all features of the web interface are supported.
+
=head1 SEE ALSO
+efa-m(1), Travel::Status::DE::VRR::Result(3pm).
+
=head1 AUTHOR
Copyright (C) 2011 by Daniel Friesel E<lt>derf@finalrewind.orgE<gt>
diff --git a/lib/Travel/Status/DE/VRR/Result.pm b/lib/Travel/Status/DE/VRR/Result.pm
index a61a9d2..083e225 100644
--- a/lib/Travel/Status/DE/VRR/Result.pm
+++ b/lib/Travel/Status/DE/VRR/Result.pm
@@ -29,24 +29,72 @@ departure received by Travel::Status::DE::VRR
=head1 SYNOPSIS
+ for my $departure ($status->results) {
+ printf(
+ "At %s: %s to %s from platform %s\n",
+ $departure->time, $departure->line, $departure->destination,
+ $departure->platform
+ );
+ }
+
=head1 VERSION
version 0.00
=head1 DESCRIPTION
+Travel::Status::DE::VRR::Result describes a single departure as obtained by
+TRavel::Status::DE::VRR. It contains information about the time, platform,
+line number and destination.
+
=head1 METHODS
=head2 ACCESSORS
=over
+=item $departure->destination
+
+The tram/bus/train destination.
+
+=item $departure->line
+
+The name/number of the line.
+
+=item $departure->platform
+
+The departure platform. Note that this is prefixed by either "Bstg." (for
+tram/bus departures) or "Gleis" (for trains).
+
+=item $departure->time
+
+The departure time as string in "HH:MM" format.
+
=back
=head2 INTERNAL
=over
+=item $departure = Travel::Status::DE::VRR::Result->new(I<%data>)
+
+Returns a new Travel::Status::DE::VRR::Result object. You should not need to
+call this.
+
+Required I<data>:
+
+=over
+
+=item B<destination> => I<string>
+
+=item B<line> => I<string>
+
+=item B<platform> => I<string>
+
+=item B<time> => I<string>
+
+=back
+
=back
=head1 DIAGNOSTICS
@@ -63,8 +111,12 @@ None.
=head1 BUGS AND LIMITATIONS
+Unknown.
+
=head1 SEE ALSO
+Travel::Status::DE::VRR(3pm).
+
=head1 AUTHOR
Copyright (C) 2011 by Daniel Friesel E<lt>derf@finalrewind.orgE<gt>