Bing::Search::Result::InstantAnswer::FlightStatus - Flight status from Bing


Bing-Search documentation Contained in the Bing-Search distribution.

Index


Code Index:

NAME

Top

Bing::Search::Result::InstantAnswer::FlightStatus - Flight status from Bing

METHODS

Top

DepartureTerminal

The departure terminal.

FlightNumber

The flight number.

ArrivalGate

The arrival gate.

ScheduledDeparture

A DateTime object representing the scheduled departure time.

OnTimeString

A string indicating if the flight's on-time status.

UpdatedDeparture

A DateTime object representing the updated departure time, if any.

UpdatedArrival

A DateTime object representing the updated arrival time, if any.

DataFreshness

An integer indicating how "fresh" the data is.

AirlineCode

The airline code. Usually two letters.

DepartureGate

The departure gate.

StatusCode

A 2-digit code indicating the status of the flight.

ScheduledArrival

A DateTime object representing the scheduled arrival time.

ArrivalTerminal

The arrival terminal.

FlightHistoryId

A unique identifier for a specific instance of a flight.

AirlineName

The name of the airline.

StatusString

The status of the flight, in human-speak.

FlightName

The full name of the flight, usually a combination of the airline code and the flight number.

OriginAirport and DestinationAirport

Two objects representing the airports where the flight originated and is destined. Each has a Code (such as "SEA" for Seattle), a Name ("Seattle"), and a TimezoneOffset (a number, in seconds, from UTC).

Unimplemented bits

Mostly because I didn't see these in the spec, and am just writing docs right now, the following bits are not currently implemented, and therefor will remain in the data hash.

* NextSegment/FlightHistoryId - Unique Id
* NextSegment/OriginAirport - Airport Code
* NextSegment/DestinationAirport - Airport Code
* The above three are repeated for "PreviousSegment"

AUTHOR

Top

Dave Houston, dhouston@cpan.org, 2010

LICENSE

Top

This library is free software; you may redistribute and/or modify it under the same terms as Perl itself.


Bing-Search documentation Contained in the Bing-Search distribution.

package Bing::Search::Result::InstantAnswer::FlightStatus;
use Moose;
use Bing::Search::Result::InstantAnswer::FlightStatus::Airport;

extends 'Bing::Search::Result';

with 'Bing::Search::Role::Types::UrlType';
with 'Bing::Search::Role::Types::DateType';

with qw(
   Bing::Search::Role::Result::DepartureTerminal
   Bing::Search::Role::Result::FlightNumber
   Bing::Search::Role::Result::ArrivalGate
   Bing::Search::Role::Result::ScheduledDeparture
   Bing::Search::Role::Result::OnTimeString
   Bing::Search::Role::Result::UpdatedDeparture
   Bing::Search::Role::Result::UpdatedArrival
   Bing::Search::Role::Result::DataFreshness
   Bing::Search::Role::Result::AirlineCode
   Bing::Search::Role::Result::DepartureGate
   Bing::Search::Role::Result::StatusCode
   Bing::Search::Role::Result::ScheduledArrival
   Bing::Search::Role::Result::ArrivalTerminal
   Bing::Search::Role::Result::FlightHistoryId
   Bing::Search::Role::Result::AirlineName
   Bing::Search::Role::Result::StatusString
   Bing::Search::Role::Result::FlightName
);

has [qw(OriginAirport DestinationAirport)] => ( 
   is => 'rw',
   isa => 'Bing::Search::Result::InstantAnswer::FlightStatus::Airport'
);

before '_populate' => sub { 
   my $self = shift;
   my $data = $self->data;
   my $dest = delete $data->{DestinationAirport};
   my $orig = delete $data->{OriginAirport};
   my $obj_dest = Bing::Search::Result::InstantAnswer::FlightStatus::Airport->new( data => $dest );
   my $obj_orig = Bing::Search::Result::InstantAnswer::FlightStatus::Airport->new( data => $orig );
   $_->_populate() for ($obj_dest, $obj_orig);
   $self->DestinationAirport( $obj_dest );
   $self->OriginAirport( $obj_orig );
};

__PACKAGE__->meta->make_immutable;