summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-05-09 10:02:05 +0200
committerDaniel Friesel <derf@finalrewind.org>2015-05-09 10:02:05 +0200
commitf2d2e5bda1cf5789b75773ae35c6f6dcb01c71fe (patch)
tree21eab82f72c66c60c69ae359a35853081306164a
parentfd5b343a0b56e0e887ab514b38496212beac7b8d (diff)
parenta58a9a6c73057275e1b05e4196110864d6146e51 (diff)
Merge branch 'master' of lastlight:var/git_root/Travel-Status-DE-DeutscheBahn
Conflicts: Changelog
-rw-r--r--Changelog1
-rw-r--r--lib/Travel/Status/DE/DeutscheBahn/Result.pm14
2 files changed, 15 insertions, 0 deletions
diff --git a/Changelog b/Changelog
index bd035fe..223b0dd 100644
--- a/Changelog
+++ b/Changelog
@@ -2,6 +2,7 @@ git HEAD
* Result->route_interesting: Also consider airports
* Result: Add route_info accessor
+ * Result: Add is_cancelled accessor
Travel::Status::DE::DeutscheBahn 1.04 - Sun May 03 2015
diff --git a/lib/Travel/Status/DE/DeutscheBahn/Result.pm b/lib/Travel/Status/DE/DeutscheBahn/Result.pm
index bf300ed..43ce27b 100644
--- a/lib/Travel/Status/DE/DeutscheBahn/Result.pm
+++ b/lib/Travel/Status/DE/DeutscheBahn/Result.pm
@@ -62,6 +62,16 @@ sub delay {
return;
}
+sub is_cancelled {
+ my ($self) = @_;
+ my $info = $self->info_raw;
+
+ if ( $info =~ m{ Fahrt \s f.llt \s aus }ox ) {
+ return 1;
+ }
+ return 0;
+}
+
sub origin {
my ($self) = @_;
@@ -218,6 +228,10 @@ Returns the train's delay in minutes, or undef if it is unknown.
Returns additional information, for instance the reason why the train is
delayed. May be an empty string if no (useful) information is available.
+=item $result->is_cancelled
+
+True if the train was cancelled, false otherwise.
+
=item $result->line
=item $result->train