From 77777eb14cdcdccd744453f2f30153d430aa4e66 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 23 Jun 2019 16:53:01 +0200 Subject: ->direction: Compute direction if necessary --- lib/Travel/Status/DE/DBWagenreihung.pm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/Travel/Status') diff --git a/lib/Travel/Status/DE/DBWagenreihung.pm b/lib/Travel/Status/DE/DBWagenreihung.pm index ea37382..1952646 100644 --- a/lib/Travel/Status/DE/DBWagenreihung.pm +++ b/lib/Travel/Status/DE/DBWagenreihung.pm @@ -102,6 +102,12 @@ sub errstr { sub direction { my ($self) = @_; + if ( not exists $self->{direction} ) { + + # direction is set while parsing wagons + $self->wagons; + } + return $self->{direction}; } -- cgit v1.2.3