summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE/IRIS
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2013-12-21 16:46:10 +0100
committerDaniel Friesel <derf@finalrewind.org>2013-12-21 16:46:10 +0100
commit3b362b46291e9e66b15a428ad247ce21a2f5e388 (patch)
tree85ef975fddcd6d4eda460350a0ef5e6119048132 /lib/Travel/Status/DE/IRIS
parente360b55ec5d4d9e725510400a2ecd14dd14fb8c5 (diff)
Result: Fix route, route_{post,pre,interesting}
Diffstat (limited to 'lib/Travel/Status/DE/IRIS')
-rw-r--r--lib/Travel/Status/DE/IRIS/Result.pm22
1 files changed, 20 insertions, 2 deletions
diff --git a/lib/Travel/Status/DE/IRIS/Result.pm b/lib/Travel/Status/DE/IRIS/Result.pm
index d422f6d..fbb519a 100644
--- a/lib/Travel/Status/DE/IRIS/Result.pm
+++ b/lib/Travel/Status/DE/IRIS/Result.pm
@@ -14,7 +14,7 @@ use DateTime::Format::Strptime;
our $VERSION = '0.00';
Travel::Status::DE::IRIS::Result->mk_ro_accessors(
- qw(arrival date datetime departure line_no raw_id route route_post route_pre
+ qw(arrival date datetime departure line_no raw_id
route_start route_end
start stop_no time train_id train_no type unknown_t unknown_o)
);
@@ -82,6 +82,24 @@ sub line {
sprintf( '%s %s', $self->{type}, $self->{line_no} // $self->{train_no} );
}
+sub route_pre {
+ my ($self) = @_;
+
+ return @{$self->{route_pre}};
+}
+
+sub route_post {
+ my ($self) = @_;
+
+ return @{$self->{route_post}};
+}
+
+sub route {
+ my ($self) = @_;
+
+ return ($self->route_pre, $self->{station}, $self->route_post);
+}
+
sub train {
my ($self) = @_;
@@ -91,7 +109,7 @@ sub train {
sub route_interesting {
my ( $self, $max_parts ) = @_;
- my @via = $self->route;
+ my @via = $self->route_post;
my ( @via_main, @via_show, $last_stop );
$max_parts //= 3;