| 1 | package WebService::OpenSky::Response::FlightTrack; | ||||||||||||||
| 2 | |||||||||||||||
| 3 | # ABSTRACT: A class representing a flight track from the OpenSky Network API | ||||||||||||||
| 4 | 8 | ▶ | use WebService::OpenSky::Moose; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | 8 | ▶ | use WebService::OpenSky::Core::Waypoint; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 6 | 8 | extends 'WebService::OpenSky::Response'; | |||||||||||||
| 7 | |||||||||||||||
| 8 | 8 | our $VERSION = '0.5'; | |||||||||||||
| 9 | |||||||||||||||
| 10 | 8 | my @ATTRS = qw( | |||||||||||||
| 11 | icao24 | ||||||||||||||
| 12 | callsign | ||||||||||||||
| 13 | startTime | ||||||||||||||
| 14 | endTime | ||||||||||||||
| 15 | path | ||||||||||||||
| 16 | ); | ||||||||||||||
| 17 | |||||||||||||||
| 18 | # XXX ugly, but this is part of an experimental API endpoint from OpenSky | ||||||||||||||
| 19 | 8 | param [@ATTRS] => ( is => 'rw', required => 0 ); | |||||||||||||
| 20 | |||||||||||||||
| 21 | 2 | ▶ | method BUILD(@args) { | ||||||||||||
|
Subroutine
BUILD: called CC=3 SCAR=11.0
Pod
undocumented
Branch: 1 branch
| |||||||||||||||
| 22 | 2 | foreach my $attr (@ATTRS) { | |||||||||||||
| 23 | 10 | $self->$attr( $self->raw_response->{$attr} ); | |||||||||||||
| 24 | } | ||||||||||||||
| 25 | 8 | } | |||||||||||||
| 26 | |||||||||||||||
| 27 | 2 | ▶ | method _create_response_objects() { | ||||||||||||
|
Subroutine
_create_response_objects: called CC=3 SCAR=11.1
Branch: 2 branches
| |||||||||||||||
| 28 | 2 | my @path = map { WebService::OpenSky::Core::Waypoint->new($_) } $self->path->@*; | |||||||||||||
| 29 | 2 | $self->path( \@path ); | |||||||||||||
| 30 | 2 | return \@path; | |||||||||||||
| 31 | 8 | } | |||||||||||||
| 32 | |||||||||||||||
| 33 | 1 | ▶ | method _empty_response() { | ||||||||||||
|
Subroutine
_empty_response: called CC=3 SCAR=11.3
Branch: 2 branches
| |||||||||||||||
| 34 | 1 | return { path => [] }; | |||||||||||||
| 35 | } | ||||||||||||||
| 36 | |||||||||||||||
| 37 | __END__ | ||||||||||||||