summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE/DeutscheBahn/Result.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-09-02 19:23:56 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-09-02 19:23:56 +0200
commitca37cdd0009298b677ffbc356741098d609c474d (patch)
tree78b5f08a5947232e4e76e55c128d3ec6a295d403 /lib/Travel/Status/DE/DeutscheBahn/Result.pm
parent40a308971dd32d9b7468ae3c2ef313e636f888e9 (diff)
DeutscheBahn/Result.pm: Add route_timetable accessor
Diffstat (limited to 'lib/Travel/Status/DE/DeutscheBahn/Result.pm')
-rw-r--r--lib/Travel/Status/DE/DeutscheBahn/Result.pm14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/Travel/Status/DE/DeutscheBahn/Result.pm b/lib/Travel/Status/DE/DeutscheBahn/Result.pm
index 1ed2527..1d05fe9 100644
--- a/lib/Travel/Status/DE/DeutscheBahn/Result.pm
+++ b/lib/Travel/Status/DE/DeutscheBahn/Result.pm
@@ -62,7 +62,8 @@ sub origin {
sub route {
my ($self) = @_;
- return @{ $self->{route} };
+ my @stops = map { $_->[1] } @{ $self->{route} };
+ return @stops;
}
sub route_interesting {
@@ -115,6 +116,12 @@ sub route_interesting {
}
+sub route_timetable {
+ my ($self) = @_;
+
+ return @{ $self->{route} };
+}
+
1;
__END__
@@ -217,6 +224,11 @@ Returns the raw string used to create the route array.
Note that canceled stops are filtered from B<route>, but still present in
B<route_raw>.
+=item $result->route_timetable
+
+Similar to B<route>. however, this function returns a list of array
+references of the form C<< [ arrival time, station name ] >>.
+
=item $result->time
Returns the arrival/departure time as string in "hh:mm" format.