summaryrefslogtreecommitdiff
path: root/lib/Travel
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-10-12 13:44:12 +0200
committerDaniel Friesel <derf@finalrewind.org>2015-10-12 13:44:12 +0200
commit5600e3863c9dc8b321e5f580a3e7bbd4c64da892 (patch)
tree0d72731e0ad4f95e6d12bb411af00fa0de799449 /lib/Travel
parentd64dec80bc37609090b3f1ba3b253da5ed3c9bde (diff)
add devmode option (moar debugging)
Diffstat (limited to 'lib/Travel')
-rw-r--r--lib/Travel/Status/DE/URA.pm19
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/Travel/Status/DE/URA.pm b/lib/Travel/Status/DE/URA.pm
index 1a11d26..eb1c7de 100644
--- a/lib/Travel/Status/DE/URA.pm
+++ b/lib/Travel/Status/DE/URA.pm
@@ -32,13 +32,14 @@ sub new {
my $self = {
datetime => $opt{datetime}
// DateTime->now( time_zone => 'Europe/Berlin' ),
- ura_base => $opt{ura_base},
- ura_version => $opt{ura_version},
- full_routes => $opt{calculate_routes} // 0,
- hide_past => $opt{hide_past} // 1,
- stop => $opt{stop},
- via => $opt{via},
- post => {
+ developer_mode => $opt{developer_mode},
+ ura_base => $opt{ura_base},
+ ura_version => $opt{ura_version},
+ full_routes => $opt{calculate_routes} // 0,
+ hide_past => $opt{hide_past} // 1,
+ stop => $opt{stop},
+ via => $opt{via},
+ post => {
ReturnList =>
'lineid,linename,directionid,destinationtext,vehicleid,'
. 'tripid,estimatedtime,stopid,stoppointname'
@@ -66,6 +67,10 @@ sub new {
$self->{raw_str} = $response->decoded_content;
+ if ( $self->{developer_mode} ) {
+ say $self->{raw_str};
+ }
+
# Fix encoding in case we're running through test files
if ( substr( $self->{ura_instant_url}, 0, 5 ) eq 'file:' ) {
$self->{raw_str} = encode( 'UTF-8', $self->{raw_str} );