From 74a7960da8590e7a105a827642f620816903ad8d Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Wed, 6 Jul 2011 19:28:50 +0200 Subject: DeutscheBahn.pm: Fix new_from_html --- lib/Travel/Status/DE/DeutscheBahn.pm | 9 +++++++-- 1 file 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}, -- cgit v1.2.3