summaryrefslogtreecommitdiff
path: root/index.pl
diff options
context:
space:
mode:
Diffstat (limited to 'index.pl')
-rw-r--r--index.pl18
1 files changed, 6 insertions, 12 deletions
diff --git a/index.pl b/index.pl
index 03908fc..6532efd 100644
--- a/index.pl
+++ b/index.pl
@@ -449,10 +449,8 @@ sub handle_request {
origin => $result->origin,
platform => $platform,
info => $info,
- is_cancelled => $result->can('is_cancelled')
- ? $result->is_cancelled
- : undef,
- messages => {
+ is_cancelled => $result->is_cancelled,
+ messages => {
delay => [
map { { timestamp => $_->[0], text => $_->[1] } }
$result->delay_messages
@@ -466,18 +464,14 @@ sub handle_request {
delay => $delay,
additional_stops => [ $result->additional_stops ],
canceled_stops => [ $result->canceled_stops ],
- replaced_by => $result->can('replaced_by')
- ? [
+ replaced_by => [
map { $_->type . q{ } . $_->train_no }
$result->replaced_by
- ]
- : [],
- replacement_for => $result->can('replacement_for')
- ? [
+ ],
+ replacement_for => [
map { $_->type . q{ } . $_->train_no }
$result->replacement_for
- ]
- : [],
+ ],
}
);
}