From 2e6079b836075221e462cb44c11a3ec23707f462 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 2 Jan 2019 13:25:08 +0100 Subject: Add generic train data accessors --- lib/Travel/Status/DE/DBWagenreihung.pm | 36 ++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'lib/Travel/Status') diff --git a/lib/Travel/Status/DE/DBWagenreihung.pm b/lib/Travel/Status/DE/DBWagenreihung.pm index 6d4f551..7f5d486 100644 --- a/lib/Travel/Status/DE/DBWagenreihung.pm +++ b/lib/Travel/Status/DE/DBWagenreihung.pm @@ -92,6 +92,12 @@ sub direction { return $self->{direction}; } +sub platform { + my ($self) = @_; + + return $self->{data}{istformation}{halt}{gleisbezeichnung}; +} + sub sections { my ($self) = @_; @@ -119,6 +125,36 @@ sub sections { return @{ $self->{sections} // [] }; } +sub station_ds100 { + my ($self) = @_; + + return $self->{data}{istformation}{halt}{rl100}; +} + +sub station_name { + my ($self) = @_; + + return $self->{data}{istformation}{halt}{bahnhofsname}; +} + +sub station_uic { + my ($self) = @_; + + return $self->{data}{istformation}{halt}{evanummer}; +} + +sub train_type { + my ($self) = @_; + + return $self->{data}{istformation}{zuggattung}; +} + +sub train_no { + my ($self) = @_; + + return $self->{data}{istformation}{zugnummer}; +} + sub wagons { my ($self) = @_; -- cgit v1.2.3