From de828666cfafcf2d767e67c5f0d568f9e6eb9be0 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 26 Jul 2015 20:31:12 +0200 Subject: add mot filter support --- lib/Travel/Status/DE/EFA/Line.pm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lib/Travel/Status/DE/EFA/Line.pm') diff --git a/lib/Travel/Status/DE/EFA/Line.pm b/lib/Travel/Status/DE/EFA/Line.pm index 35560b2..0f5f090 100644 --- a/lib/Travel/Status/DE/EFA/Line.pm +++ b/lib/Travel/Status/DE/EFA/Line.pm @@ -9,7 +9,12 @@ use parent 'Class::Accessor'; our $VERSION = '1.11'; Travel::Status::DE::EFA::Line->mk_ro_accessors( - qw(direction name operator route type valid)); + qw(direction mot name operator route type valid)); + +my @mot_mapping = qw{ + zug s-bahn u-bahn stadtbahn tram stadtbus regionalbus + schnellbus seilbahn schiff ast sonstige +}; sub new { my ( $obj, %conf ) = @_; @@ -19,6 +24,12 @@ sub new { return bless( $ref, $obj ); } +sub mot_name { + my ($self) = @_; + + return $mot_mapping[ $self->{mot} ] // 'sonstige'; +} + sub TO_JSON { my ($self) = @_; -- cgit v1.2.3