summaryrefslogtreecommitdiff
path: root/lib/Travel/Status
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Travel/Status')
-rw-r--r--lib/Travel/Status/DE/IRIS.pm11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/Travel/Status/DE/IRIS.pm b/lib/Travel/Status/DE/IRIS.pm
index 89a7c02..4a4d3f4 100644
--- a/lib/Travel/Status/DE/IRIS.pm
+++ b/lib/Travel/Status/DE/IRIS.pm
@@ -19,7 +19,9 @@ use XML::LibXML;
sub new {
my ( $class, %opt ) = @_;
- my $ua = LWP::UserAgent->new(%opt);
+ my %lwp_options = %{ $opt{lwp_options} // { timeout => 10 } };
+
+ my $ua = LWP::UserAgent->new( %{ $opt{lwp_options} } );
if ( not $opt{station} ) {
confess('station flag must be passed');
@@ -448,6 +450,11 @@ have no effect. However, as the IRIS occasionally contains unscheduled
departures or qos messages known far in advance (e.g. 12 hours from now), any
non-negative integer is accepted.
+=item B<lwp_options> => I<\%hashref>
+
+Passed on to C<< LWP::UserAgent->new >>. Defaults to C<< { timeout => 10 } >>,
+use an empty hashref to override.
+
=item B<station> => I<stationcode>
Mandatory: Which station to return departures for. Note that this is not a
@@ -457,8 +464,6 @@ name to code mapping.
=back
-All other options are passed to the LWP::UserAgent(3pm) constructor.
-
=item $status->errstr
In case of a fatal HTTP request or IRIS error, returns a string describing it.