diff options
author | Daniel Friesel <derf@finalrewind.org> | 2016-02-02 19:24:05 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2016-02-02 19:24:05 +0100 |
commit | 9655770c70740e5828414ef0795a5e8eb71c227c (patch) | |
tree | 1b7e178e8ce77537ed55e0b69c2cbe6dff9fb09f | |
parent | f5758258671d2522e3cb3ec1a8a1e8133d631b33 (diff) |
update changelog, run code through perltidy
-rw-r--r-- | Changelog | 5 | ||||
-rw-r--r-- | lib/Travel/Status/DE/URA.pm | 12 |
2 files changed, 13 insertions, 4 deletions
@@ -1,3 +1,8 @@ +git HEAD + + * URA->New: Add viaID, stopID, lineID and circle parameters + * URA: Add get_stops accessor + Travel::Status::DE::URA 1.00 - Sat Oct 31 2015 * Reduce memory footprint diff --git a/lib/Travel/Status/DE/URA.pm b/lib/Travel/Status/DE/URA.pm index b6b6e12..8079ab6 100644 --- a/lib/Travel/Status/DE/URA.pm +++ b/lib/Travel/Status/DE/URA.pm @@ -78,7 +78,9 @@ sub new { $self->{post}{StopID} = $self->{stopID}; # filter for via as well to make via work - $self->{post}{StopID} .= ',' . $self->{viaID} if $self->{viaID}; + if ( defined $self->{viaId} ) { + $self->{post}{StopID} .= q{,} . $self->{viaID}; + } } # filter by line @@ -105,7 +107,7 @@ sub new { my $raw_str = $response->decoded_content; if ( $self->{developer_mode} ) { - say decode('UTF-8', $raw_str); + say decode( 'UTF-8', $raw_str ); } # Fix encoding in case we're running through test files @@ -144,7 +146,7 @@ sub parse_raw_data { my $latitude = $fields[4]; # create Stop Dict - if ( !$self->{stops}{$stop_id} ) { + if ( not exists $self->{stops}{$stop_id} ) { $self->{stops}{$stop_id} = Travel::Status::DE::URA::Stop->new( name => decode( 'UTF-8', $stop_name ), id => $stop_id, @@ -216,7 +218,9 @@ sub results { my ( @route_pre, @route_post ); # only work on Prediction informations - next unless $type == TYPE_PREDICTION; + if ( $type != TYPE_PREDICTION ) { + next; + } if ( $stop and not( $stopname eq $stop ) ) { next; |