API/Flights.pm

filter: Statementstmt 82.6% 19 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod n/a totaltotal 82.7% 24 / 29 CC 1 SCAR 1.5
CC
1
Cov
83%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« API/States.pm ↑ Summary API/Core/Flight.pm »
1 # A class representing a flights response from the OpenSky Network API
2  
3 package OpenSky::API::Flights;
4  
5 5 our $VERSION = '0.005';
6 5 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 5 ▶use OpenSky::API::Types qw(InstanceOf);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 5 ▶use OpenSky::API::Core::Flight;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 5 ▶use OpenSky::API::Utils::Iterator;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 5 ▶use experimental qw(signatures);
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 5 has flights => (
13 is => 'ro',
14 isa => InstanceOf ['OpenSky::API::Utils::Iterator'],
15 handles => [qw(first next reset all count)],
16 );
17  
18 0 ▶around 'BUILDARGS' => sub ( $orig, $class, $response ) {
Subroutine __ANON__: not called CC=1 SCAR=6.9
19 0 my @flights = map { OpenSky::API::Core::Flight->new($_) } $response->@*;
20 0 my $iterator = OpenSky::API::Utils::Iterator->new( rows => \@flights );
21  
22 0 return $class->$orig( flights => $iterator );
23 5 };
24  
25 5 __PACKAGE__->meta->make_immutable;
26  
27 __END__
« API/States.pm ↑ Summary API/Core/Flight.pm »