diff options
author | Daniel Friesel <derf@finalrewind.org> | 2011-07-06 19:28:50 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-07-06 19:28:50 +0200 |
commit | 74a7960da8590e7a105a827642f620816903ad8d (patch) | |
tree | 2e4a8e2cd1829f115453d19715c4c6f25e6a678e | |
parent | b96b0a85287c997e350056c39e9b6bdfcd2a66a4 (diff) |
DeutscheBahn.pm: Fix new_from_html
-rw-r--r-- | lib/Travel/Status/DE/DeutscheBahn.pm | 9 |
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}, |