diff --git a/lib/Travel/Status/DE/DeutscheBahn.pm b/lib/Travel/Status/DE/DeutscheBahn.pm index 8fb0ca2164f3516502e9cc5b8af2dab0cf9a9882..09834edaa1aa5c261d5b69585a5746db1d710c06 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},