diff options
author | Daniel Friesel <derf@finalrewind.org> | 2020-09-06 11:15:19 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2020-09-06 11:15:19 +0200 |
commit | b2824fcfb9ef1fcd9b09d74c472aa783d6fe0db5 (patch) | |
tree | 06581073223bab6577987be420478c9393f35fb5 /lib/DBInfoscreen.pm | |
parent | 9bdae29a17e9342eb85db11d97935789492e7dc7 (diff) |
add wagonorder helper
Diffstat (limited to 'lib/DBInfoscreen.pm')
-rw-r--r-- | lib/DBInfoscreen.pm | 15 |
1 files changed, 15 insertions, 0 deletions
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', @@ -109,6 +112,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 ) = @_; |