Loading lib/Travel/Routing/DE/DBRIS/Connection.pm +14 −0 Original line number Diff line number Diff line Loading @@ -156,6 +156,20 @@ sub TO_JSON { my $ret = { %{$self} }; delete $ret->{strptime_obj}; for my $k (qw(sched_dep rt_dep dep sched_arr rt_arr arr)) { if ( $ret->{$k} ) { $ret->{$k} = $ret->{$k}->epoch; } } for my $k (qw(sched_duration rt_duration duration)) { if ( $ret->{$k} ) { $ret->{$k} = $ret->{$k}->in_units('minutes'); } } return $ret; } Loading lib/Travel/Routing/DE/DBRIS/Connection/Segment.pm +20 −0 Original line number Diff line number Diff line Loading @@ -201,4 +201,24 @@ sub transfer_notes { return @{ $self->{transfer_notes} // [] }; } sub TO_JSON { my ($self) = @_; my $ret = { %{$self} }; for my $k (qw(sched_dep rt_dep dep sched_arr rt_arr arr)) { if ( $ret->{$k} ) { $ret->{$k} = $ret->{$k}->epoch; } } for my $k (qw(sched_duration rt_duration duration transfer_duration)) { if ( $ret->{$k} ) { $ret->{$k} = $ret->{$k}->in_units('minutes'); } } return $ret; } 1; Loading
lib/Travel/Routing/DE/DBRIS/Connection.pm +14 −0 Original line number Diff line number Diff line Loading @@ -156,6 +156,20 @@ sub TO_JSON { my $ret = { %{$self} }; delete $ret->{strptime_obj}; for my $k (qw(sched_dep rt_dep dep sched_arr rt_arr arr)) { if ( $ret->{$k} ) { $ret->{$k} = $ret->{$k}->epoch; } } for my $k (qw(sched_duration rt_duration duration)) { if ( $ret->{$k} ) { $ret->{$k} = $ret->{$k}->in_units('minutes'); } } return $ret; } Loading
lib/Travel/Routing/DE/DBRIS/Connection/Segment.pm +20 −0 Original line number Diff line number Diff line Loading @@ -201,4 +201,24 @@ sub transfer_notes { return @{ $self->{transfer_notes} // [] }; } sub TO_JSON { my ($self) = @_; my $ret = { %{$self} }; for my $k (qw(sched_dep rt_dep dep sched_arr rt_arr arr)) { if ( $ret->{$k} ) { $ret->{$k} = $ret->{$k}->epoch; } } for my $k (qw(sched_duration rt_duration duration transfer_duration)) { if ( $ret->{$k} ) { $ret->{$k} = $ret->{$k}->in_units('minutes'); } } return $ret; } 1;