summaryrefslogtreecommitdiff
path: root/lib/Travel/Routing/DE/EFA
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2017-09-17 15:10:32 +0200
committerDaniel Friesel <derf@finalrewind.org>2017-09-17 15:10:32 +0200
commitb0a9973139fe13cecc14185b6c07262c4c114fc7 (patch)
tree1fbcc18ab4254df105ff199ae253e85053940e0e /lib/Travel/Routing/DE/EFA
parentdb888ca1ca3131578bc15b5b829021c07287164f (diff)
Add API and CLI output for cancelled route parts (delay -9999)
Diffstat (limited to 'lib/Travel/Routing/DE/EFA')
-rw-r--r--lib/Travel/Routing/DE/EFA/Route/Part.pm15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/Travel/Routing/DE/EFA/Route/Part.pm b/lib/Travel/Routing/DE/EFA/Route/Part.pm
index cffe53d..c9ebfd9 100644
--- a/lib/Travel/Routing/DE/EFA/Route/Part.pm
+++ b/lib/Travel/Routing/DE/EFA/Route/Part.pm
@@ -82,6 +82,15 @@ sub footpath_parts {
return;
}
+sub is_cancelled {
+ my ($self) = @_;
+
+ if ( $self->{delay} and $self->{delay} eq '-9999' ) {
+ return 1;
+ }
+ return;
+}
+
# DEPRECATED
sub extra {
my ($self) = @_;
@@ -287,6 +296,12 @@ connection between two stops), so the B<footpath> accessors contain redundant
information. Other values such as "BEFORE" may also be returned, but this is
unknown at this point.
+=item $part->is_cancelled
+
+Returns true if this part of the route has been cancelled (i.e., the entire
+route is probably useless), false otherwise. For unknown reasons, EFA may
+sometimes return routes which contain cancelled departures.
+
=item $part->regular_notes
Remarks about the line serving this connaction part. Returns a list of