From b2824fcfb9ef1fcd9b09d74c472aa783d6fe0db5 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 6 Sep 2020 11:15:19 +0200 Subject: add wagonorder helper --- lib/DBInfoscreen.pm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib/DBInfoscreen.pm') diff --git a/lib/DBInfoscreen.pm b/lib/DBInfoscreen.pm index 700a4c9..b31a1a7 100644 --- a/lib/DBInfoscreen.pm +++ b/lib/DBInfoscreen.pm @@ -6,6 +6,7 @@ use Mojo::Base 'Mojolicious'; use Cache::File; use DBInfoscreen::Helper::HAFAS; +use DBInfoscreen::Helper::Wagonorder; use File::Slurp qw(read_file); use JSON; use Travel::Status::DE::HAFAS; @@ -18,6 +19,8 @@ no if $] >= 5.018, warnings => 'experimental::smartmatch'; our $VERSION = qx{git describe --dirty} || '0.05'; +chomp $VERSION; + my %default = ( backend => 'iris', mode => 'app', @@ -108,6 +111,18 @@ sub startup { } ); + $self->helper( + wagonorder => sub { + my ($self) = @_; + state $hafas = DBInfoscreen::Helper::Wagonorder->new( + log => $self->app->log, + cache => $self->app->cache_iris_main, + user_agent => $self->ua, + version => $VERSION, + ); + } + ); + $self->helper( 'handle_no_results' => sub { my ( $self, $backend, $station, $errstr ) = @_; -- cgit v1.2.3