summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-07-06 19:28:50 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-07-06 19:28:50 +0200
commit74a7960da8590e7a105a827642f620816903ad8d (patch)
tree2e4a8e2cd1829f115453d19715c4c6f25e6a678e
parentb96b0a85287c997e350056c39e9b6bdfcd2a66a4 (diff)
DeutscheBahn.pm: Fix new_from_html
-rw-r--r--lib/Travel/Status/DE/DeutscheBahn.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Travel/Status/DE/DeutscheBahn.pm b/lib/Travel/Status/DE/DeutscheBahn.pm
index 8fb0ca2..09834ed 100644
--- a/lib/Travel/Status/DE/DeutscheBahn.pm
+++ b/lib/Travel/Status/DE/DeutscheBahn.pm
@@ -75,9 +75,14 @@ sub new {
}
sub new_from_html {
- my ( $obj, $html ) = @_;
+ my ( $obj, %opt ) = @_;
- my $ref = { html => $html, };
+ my $ref = {
+ html => $opt{html},
+ post => { boardType => $opt{mode} // 'dep' }
+ };
+
+ $ref->{post}->{boardType} = $opt{mode} // 'dep';
$ref->{tree} = XML::LibXML->load_html(
string => $ref->{html},