summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE/HAFAS/Result.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Travel/Status/DE/HAFAS/Result.pm')
-rw-r--r--lib/Travel/Status/DE/HAFAS/Result.pm15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/Travel/Status/DE/HAFAS/Result.pm b/lib/Travel/Status/DE/HAFAS/Result.pm
index 99c320b..5048f35 100644
--- a/lib/Travel/Status/DE/HAFAS/Result.pm
+++ b/lib/Travel/Status/DE/HAFAS/Result.pm
@@ -109,6 +109,21 @@ sub type {
return $type;
}
+sub line_no {
+ my ($self) = @_;
+
+ # $self->{train} is either "TYPE 12345" or "TYPE12345"
+ my ($line_no) = ( $self->{train} =~ m{ ([^[:space:]]+) $ }x );
+
+ return $line_no;
+}
+
+sub train_no {
+ my ($self) = @_;
+
+ return $self->line_no;
+}
+
1;
__END__