summaryrefslogtreecommitdiff
path: root/lib/Travel
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-05-01 20:33:00 +0200
committerDaniel Friesel <derf@finalrewind.org>2015-05-01 20:33:00 +0200
commit7bdbf7c77480d17d4a0dbfbc5272c2f54639a662 (patch)
tree67e1dabfb39d311e7b298d813c662b7097d01c61 /lib/Travel
parent43e06258708282b60b6198166db2185689a408c1 (diff)
->new: add lwp_options parameter
Diffstat (limited to 'lib/Travel')
-rw-r--r--lib/Travel/Status/DE/DeutscheBahn.pm9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Travel/Status/DE/DeutscheBahn.pm b/lib/Travel/Status/DE/DeutscheBahn.pm
index b8918e6..0a40b3b 100644
--- a/lib/Travel/Status/DE/DeutscheBahn.pm
+++ b/lib/Travel/Status/DE/DeutscheBahn.pm
@@ -19,7 +19,9 @@ sub new {
my $date = strftime( '%d.%m.%Y', localtime(time) );
my $time = strftime( '%H:%M', localtime(time) );
- my $ua = LWP::UserAgent->new();
+ my %lwp_options = %{ $conf{lwp_options} // { timeout => 10 } };
+
+ my $ua = LWP::UserAgent->new(%lwp_options);
$ua->env_proxy;
@@ -326,6 +328,11 @@ Date to report for. Defaults to the current day.
Set language for additional information. Accepted arguments: B<d>eutsch,
B<e>nglish, B<i>talian, B<n> (dutch).
+=item B<lwp_options> => I<\%hashref>
+
+Passed on to C<< LWP::UserAgent->new >>. Defaults to C<< { timeout => 10 } >>,
+you can use an empty hashref to override it.
+
=item B<time> => I<hh>:I<mm>
Time to report for. Defaults to now.