From 77e4998708a31d38e4d04f185c9fc12e26245d2c Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 16 Nov 2019 15:24:16 +0100 Subject: move station -> location map to generic helper --- lib/Travelynx.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib/Travelynx.pm') diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm index d2ee821..741af2a 100755 --- a/lib/Travelynx.pm +++ b/lib/Travelynx.pm @@ -168,6 +168,21 @@ sub startup { } ); + $self->attr( + coordinates_by_station => sub { + my %location; + for + my $station ( Travel::Status::DE::IRIS::Stations::get_stations() ) + { + if ( $station->[3] ) { + $location{ $station->[1] } + = [ $station->[4], $station->[3] ]; + } + } + return \%location; + } + ); + $self->helper( sendmail => sub { state $sendmail = Travelynx::Helper::Sendmail->new( -- cgit v1.2.3