summaryrefslogtreecommitdiff
path: root/lib/Travel/Routing/DE/VRR/Route/Part.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-12-04 10:10:24 +0100
committerDaniel Friesel <derf@finalrewind.org>2011-12-04 10:10:24 +0100
commitdc9a1c2a7a463345eade0fd058fd5119f3d39742 (patch)
tree1006551ef1e59115daa95aaf9b458a329fdb6eb4 /lib/Travel/Routing/DE/VRR/Route/Part.pm
parentda4a7037418415e9c2c76831c7f5fb75b1045cc8 (diff)
Route/Part: _stop_and_platform: Only concatenate if platform is non-empty
Diffstat (limited to 'lib/Travel/Routing/DE/VRR/Route/Part.pm')
-rw-r--r--lib/Travel/Routing/DE/VRR/Route/Part.pm15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/Travel/Routing/DE/VRR/Route/Part.pm b/lib/Travel/Routing/DE/VRR/Route/Part.pm
index e49e122..7fdb6da 100644
--- a/lib/Travel/Routing/DE/VRR/Route/Part.pm
+++ b/lib/Travel/Routing/DE/VRR/Route/Part.pm
@@ -28,14 +28,23 @@ sub new {
sub arrival_stop_and_platform {
my ($self) = @_;
- return sprintf( '%s: %s', $self->get(qw(arrival_stop arrival_platform)) );
+ if ( length( $self->arrival_platform ) ) {
+ return
+ sprintf( '%s: %s', $self->get(qw(arrival_stop arrival_platform)) );
+ }
+ return $self->arrival_stop;
}
sub departure_stop_and_platform {
my ($self) = @_;
- return
- sprintf( '%s: %s', $self->get(qw(departure_stop departure_platform)) );
+ if ( length( $self->departure_platform ) ) {
+
+ return
+ sprintf( '%s: %s',
+ $self->get(qw(departure_stop departure_platform)) );
+ }
+ return $self->arrival_stop;
}
sub extra {