diff options
author | Daniel Friesel <derf@finalrewind.org> | 2011-11-19 19:55:37 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-11-19 20:31:25 +0100 |
commit | 523817239799733c15b900506ad57c5fc87c29de (patch) | |
tree | 8aa75cbeba4d828d2d5ccc99f6fc96d598d0ebbf /lib | |
parent | c95333993e11598c36411bf432e5508d7e6fa1b7 (diff) |
sanitize platform number, add platform_db accessor
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Travel/Status/DE/VRR.pm | 7 | ||||
-rw-r--r-- | lib/Travel/Status/DE/VRR/Result.pm | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/lib/Travel/Status/DE/VRR.pm b/lib/Travel/Status/DE/VRR.pm index f976c1e..065d56c 100644 --- a/lib/Travel/Status/DE/VRR.pm +++ b/lib/Travel/Status/DE/VRR.pm @@ -187,12 +187,19 @@ sub results { my $countdown = $e->getAttribute('countdown'); my $delay = $e_info->getAttribute('delay') // 0; + my $platform_is_db = 0; + + if ( $platform =~ s{ ^ \# }{}ox ) { + $platform_is_db = 1; + } + push( @results, Travel::Status::DE::VRR::Result->new( date => $rdate, time => $rtime, platform => $platform, + platform_db => $platform_is_db, line => $line, destination => decode( 'UTF-8', $dest ), countdown => $countdown, diff --git a/lib/Travel/Status/DE/VRR/Result.pm b/lib/Travel/Status/DE/VRR/Result.pm index 93e651f..9fdd826 100644 --- a/lib/Travel/Status/DE/VRR/Result.pm +++ b/lib/Travel/Status/DE/VRR/Result.pm @@ -9,7 +9,7 @@ use parent 'Class::Accessor'; our $VERSION = '0.02'; Travel::Status::DE::VRR::Result->mk_ro_accessors( - qw(countdown date delay destination info line platform sched_date sched_time time type) + qw(countdown date delay destination info line platform platform_db sched_date sched_time time type) ); sub new { |