From 3c1742eb0675bf257ea5cc76b481efe37cda9f84 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 7 Jan 2020 20:04:09 +0100 Subject: Result: Fix TO_JSON helper --- lib/Travel/Status/DE/IRIS/Result.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/Travel/Status/DE/IRIS/Result.pm b/lib/Travel/Status/DE/IRIS/Result.pm index c262e71..85fcacb 100644 --- a/lib/Travel/Status/DE/IRIS/Result.pm +++ b/lib/Travel/Status/DE/IRIS/Result.pm @@ -799,8 +799,19 @@ sub TO_JSON { my %copy = %{$self}; delete $copy{arrival_wings}; delete $copy{departure_wings}; + delete $copy{realtime_xml}; delete $copy{replaced_by}; delete $copy{replacement_for}; + delete $copy{strptime_obj}; + delete $copy{wing_of}; + + for my $datetime_key ( + qw(arrival departure sched_arrival sched_departure start datetime)) + { + if ( defined $copy{$datetime_key} ) { + $copy{$datetime_key} = $copy{$datetime_key}->epoch; + } + } return {%copy}; } -- cgit v1.2.3