| 1 | package Travel::Status::DE::EFA::Stop; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 2 | ▶ | use 5.010; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||
| 7 | 2 | ▶ | use parent 'Class::Accessor'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||
| 9 | 2 | our $VERSION = '3.22'; | |||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||
| 11 | 2 | Travel::Status::DE::EFA::Stop->mk_ro_accessors( | |||||||||||||||||||||||||||||||||||||||||
| 12 | qw(sched_arr rt_arr arr arr_delay | ||||||||||||||||||||||||||||||||||||||||||
| 13 | sched_dep rt_dep dep dep_delay | ||||||||||||||||||||||||||||||||||||||||||
| 14 | occupancy delay distance_m is_cancelled | ||||||||||||||||||||||||||||||||||||||||||
| 15 | place name full_name id_num id_code latlon | ||||||||||||||||||||||||||||||||||||||||||
| 16 | platform niveau) | ||||||||||||||||||||||||||||||||||||||||||
| 17 | ); | ||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||
| 19 | 6 | ▶ | sub new { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=18 SCAR=43.1
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 20 | 6 | my ( $obj, %conf ) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||
| 22 | 6 | my $ref = \%conf; | |||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||
| 24 | 6 | ▶ | if ( $ref->{sched_arr} and $ref->{arr_delay} and not $ref->{rt_arr} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$ref->{"sched_arr"} and $ref->{"arr_delay"} and not $ref->{"rt_arr"}
$ref->{"sched_arr"} and $ref->{"arr_delay"}
MC/DC0%0/3
$ref->{"sched_arr"} and $ref->{"arr_delay"} and not $ref->{"rt_arr"}
$ref->{"sched_arr"}
$ref->{"arr_delay"}
not $ref->{"rt_arr"}
Truth table25%1/4
A and B and not(C)
A= $ref->{"sched_arr"}B= $ref->{"arr_delay"}C= not $ref->{"rt_arr"}
| |||||||||||||||||||||||||||||||||||||||||||
| 25 | $ref->{rt_arr} | ||||||||||||||||||||||||||||||||||||||||||
| 26 | 0 | = $ref->{sched_arr}->clone->add( minutes => $ref->{arr_delay} ); | |||||||||||||||||||||||||||||||||||||||||
| 27 | } | ||||||||||||||||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||||||||||||||||
| 29 | 6 | ▶ | if ( $ref->{sched_dep} and $ref->{dep_delay} and not $ref->{rt_dep} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$ref->{"sched_dep"} and $ref->{"dep_delay"} and not $ref->{"rt_dep"}
$ref->{"sched_dep"} and $ref->{"dep_delay"}
MC/DC0%0/3
$ref->{"sched_dep"} and $ref->{"dep_delay"} and not $ref->{"rt_dep"}
$ref->{"sched_dep"}
$ref->{"dep_delay"}
not $ref->{"rt_dep"}
Truth table25%1/4
A and B and not(C)
A= $ref->{"sched_dep"}B= $ref->{"dep_delay"}C= not $ref->{"rt_dep"}
| |||||||||||||||||||||||||||||||||||||||||||
| 30 | $ref->{rt_dep} | ||||||||||||||||||||||||||||||||||||||||||
| 31 | 0 | = $ref->{sched_dep}->clone->add( minutes => $ref->{dep_delay} ); | |||||||||||||||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||
| 34 | 6 | ▶ | $ref->{arr} //= $ref->{rt_arr} // $ref->{sched_arr}; | ||||||||||||||||||||||||||||||||||||||||
|
Condition33%2/6
$ref->{"arr"} //= $ref->{"rt_arr"} // $ref->{"sched_arr"}
$ref->{"rt_arr"} // $ref->{"sched_arr"}
MC/DC0%0/3
$ref->{"arr"} //= $ref->{"rt_arr"} // $ref->{"sched_arr"}
$ref->{"arr"}
$ref->{"rt_arr"}
$ref->{"sched_arr"}
Truth table0%0/4
A //= B // C
A= $ref->{"arr"}B= $ref->{"rt_arr"}C= $ref->{"sched_arr"}
| |||||||||||||||||||||||||||||||||||||||||||
| 35 | 6 | ▶ | $ref->{dep} //= $ref->{rt_dep} // $ref->{sched_dep}; | ||||||||||||||||||||||||||||||||||||||||
|
Condition33%2/6
$ref->{"dep"} //= $ref->{"rt_dep"} // $ref->{"sched_dep"}
$ref->{"rt_dep"} // $ref->{"sched_dep"}
MC/DC0%0/3
$ref->{"dep"} //= $ref->{"rt_dep"} // $ref->{"sched_dep"}
$ref->{"dep"}
$ref->{"rt_dep"}
$ref->{"sched_dep"}
Truth table0%0/4
A //= B // C
A= $ref->{"dep"}B= $ref->{"rt_dep"}C= $ref->{"sched_dep"}
| |||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||
| 37 | 6 | ▶ | if ( $ref->{rt_arr} | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$ref->{"rt_arr"} and $ref->{"sched_arr"} and not defined $ref->{"arr_delay"}
$ref->{"rt_arr"} and $ref->{"sched_arr"}
MC/DC0%0/3
$ref->{"rt_arr"} and $ref->{"sched_arr"} and not defined $ref->{"arr_delay"}
$ref->{"rt_arr"}
$ref->{"sched_arr"}
not defined $ref->{"arr_delay"}
Truth table25%1/4
A and B and not(C)
A= $ref->{"rt_arr"}B= $ref->{"sched_arr"}C= not defined $ref->{"arr_delay"}
| |||||||||||||||||||||||||||||||||||||||||||
| 38 | and $ref->{sched_arr} | ||||||||||||||||||||||||||||||||||||||||||
| 39 | and not defined $ref->{arr_delay} ) | ||||||||||||||||||||||||||||||||||||||||||
| 40 | { | ||||||||||||||||||||||||||||||||||||||||||
| 41 | $ref->{arr_delay} | ||||||||||||||||||||||||||||||||||||||||||
| 42 | = $ref->{rt_arr}->subtract_datetime( $ref->{sched_arr} ) | ||||||||||||||||||||||||||||||||||||||||||
| 43 | 0 | ->in_units('minutes'); | |||||||||||||||||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||
| 46 | 6 | ▶ | if ( $ref->{rt_dep} | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
$ref->{"rt_dep"} and $ref->{"sched_dep"} and not defined $ref->{"dep_delay"}
$ref->{"rt_dep"} and $ref->{"sched_dep"}
MC/DC0%0/3
$ref->{"rt_dep"} and $ref->{"sched_dep"} and not defined $ref->{"dep_delay"}
$ref->{"rt_dep"}
$ref->{"sched_dep"}
not defined $ref->{"dep_delay"}
Truth table25%1/4
A and B and not(C)
A= $ref->{"rt_dep"}B= $ref->{"sched_dep"}C= not defined $ref->{"dep_delay"}
| |||||||||||||||||||||||||||||||||||||||||||
| 47 | and $ref->{sched_dep} | ||||||||||||||||||||||||||||||||||||||||||
| 48 | and not defined $ref->{dep_delay} ) | ||||||||||||||||||||||||||||||||||||||||||
| 49 | { | ||||||||||||||||||||||||||||||||||||||||||
| 50 | $ref->{dep_delay} | ||||||||||||||||||||||||||||||||||||||||||
| 51 | = $ref->{rt_dep}->subtract_datetime( $ref->{sched_dep} ) | ||||||||||||||||||||||||||||||||||||||||||
| 52 | 0 | ->in_units('minutes'); | |||||||||||||||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||
| 55 | 6 | ▶ | $ref->{delay} = $ref->{dep_delay} // $ref->{arr_delay}; | ||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$ref->{"dep_delay"} // $ref->{"arr_delay"}
MC/DC0%0/2
$ref->{"dep_delay"} // $ref->{"arr_delay"}
$ref->{"dep_delay"}
$ref->{"arr_delay"}
Truth table33%1/3
A // B
A= $ref->{"dep_delay"}B= $ref->{"arr_delay"}
| |||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||
| 57 | 6 | return bless( $ref, $obj ); | |||||||||||||||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||||||||||||||||
| 59 | |||||||||||||||||||||||||||||||||||||||||||
| 60 | 0 | ▶ | sub TO_JSON { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
TO_JSON: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||
| 61 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||
| 63 | 0 | my $ret = { %{$self} }; | |||||||||||||||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||||||||||||||||
| 65 | 0 | for my $k (qw(sched_arr rt_arr arr sched_dep rt_dep dep)) { | |||||||||||||||||||||||||||||||||||||||||
| 66 | 0 | ▶ | if ( $ret->{$k} ) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 67 | 0 | $ret->{$k} = $ret->{$k}->epoch; | |||||||||||||||||||||||||||||||||||||||||
| 68 | } | ||||||||||||||||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||
| 71 | 0 | return $ret; | |||||||||||||||||||||||||||||||||||||||||
| 72 | } | ||||||||||||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||||||||||||
| 74 | 2 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||
| 76 | __END__ | ||||||||||||||||||||||||||||||||||||||||||