Class: FlightStats::FlightStatus
- Defined in:
- lib/flightstats/flight_status.rb
Constant Summary collapse
- @@base_path =
"/flex/flightstatus/rest/v2/json"
Instance Attribute Summary collapse
-
#airport_resources ⇒ Object
Returns the value of attribute airport_resources.
-
#arrival_airport_fs_code ⇒ Object
Returns the value of attribute arrival_airport_fs_code.
-
#arrival_date ⇒ Object
Returns the value of attribute arrival_date.
-
#carrier_fs_code ⇒ Object
Returns the value of attribute carrier_fs_code.
-
#codeshares ⇒ Object
Returns the value of attribute codeshares.
-
#departure_airport_fs_code ⇒ Object
Returns the value of attribute departure_airport_fs_code.
-
#departure_date ⇒ Object
Returns the value of attribute departure_date.
-
#flight_durations ⇒ Object
Returns the value of attribute flight_durations.
-
#flight_equipment ⇒ Object
Returns the value of attribute flight_equipment.
-
#flight_id ⇒ Object
Returns the value of attribute flight_id.
-
#flight_number ⇒ Object
Returns the value of attribute flight_number.
-
#operational_times ⇒ Object
Returns the value of attribute operational_times.
-
#schedule ⇒ Object
Returns the value of attribute schedule.
-
#status ⇒ Object
Returns the value of attribute status.
Attributes inherited from Resource
#attributes, #etag, #response, #uri
Class Method Summary collapse
- .arriving_on(carrier, flight_number, year, month, day, options = {}) ⇒ Object
- .base_path ⇒ Object
- .by_flight_id(flight_id, options = {}) ⇒ Object
- .departing_on(carrier, flight_number, year, month, day, options = {}) ⇒ Object
- .track_arriving_on(carrier, flight_number, year, month, day, options = {}) ⇒ Object
- .track_by_flight_id(flight_id, options = {}) ⇒ Object
- .track_departing_on(carrier, flight_number, year, month, day, options = {}) ⇒ Object
Methods inherited from Resource
from_json, from_parsed_json, from_response, #initialize, string_to_model, string_to_model_with_caching, #to_param, #underscore_with_caching
Constructor Details
This class inherits a constructor from FlightStats::Resource
Instance Attribute Details
#airport_resources ⇒ Object
Returns the value of attribute airport_resources.
3 4 5 |
# File 'lib/flightstats/flight_status.rb', line 3 def airport_resources @airport_resources end |
#arrival_airport_fs_code ⇒ Object
Returns the value of attribute arrival_airport_fs_code.
3 4 5 |
# File 'lib/flightstats/flight_status.rb', line 3 def arrival_airport_fs_code @arrival_airport_fs_code end |
#arrival_date ⇒ Object
Returns the value of attribute arrival_date.
3 4 5 |
# File 'lib/flightstats/flight_status.rb', line 3 def arrival_date @arrival_date end |
#carrier_fs_code ⇒ Object
Returns the value of attribute carrier_fs_code.
3 4 5 |
# File 'lib/flightstats/flight_status.rb', line 3 def carrier_fs_code @carrier_fs_code end |
#codeshares ⇒ Object
Returns the value of attribute codeshares.
3 4 5 |
# File 'lib/flightstats/flight_status.rb', line 3 def codeshares @codeshares end |
#departure_airport_fs_code ⇒ Object
Returns the value of attribute departure_airport_fs_code.
3 4 5 |
# File 'lib/flightstats/flight_status.rb', line 3 def departure_airport_fs_code @departure_airport_fs_code end |
#departure_date ⇒ Object
Returns the value of attribute departure_date.
3 4 5 |
# File 'lib/flightstats/flight_status.rb', line 3 def departure_date @departure_date end |
#flight_durations ⇒ Object
Returns the value of attribute flight_durations.
3 4 5 |
# File 'lib/flightstats/flight_status.rb', line 3 def flight_durations @flight_durations end |
#flight_equipment ⇒ Object
Returns the value of attribute flight_equipment.
3 4 5 |
# File 'lib/flightstats/flight_status.rb', line 3 def flight_equipment @flight_equipment end |
#flight_id ⇒ Object
Returns the value of attribute flight_id.
3 4 5 |
# File 'lib/flightstats/flight_status.rb', line 3 def flight_id @flight_id end |
#flight_number ⇒ Object
Returns the value of attribute flight_number.
3 4 5 |
# File 'lib/flightstats/flight_status.rb', line 3 def flight_number @flight_number end |
#operational_times ⇒ Object
Returns the value of attribute operational_times.
3 4 5 |
# File 'lib/flightstats/flight_status.rb', line 3 def operational_times @operational_times end |
#schedule ⇒ Object
Returns the value of attribute schedule.
3 4 5 |
# File 'lib/flightstats/flight_status.rb', line 3 def schedule @schedule end |
#status ⇒ Object
Returns the value of attribute status.
3 4 5 |
# File 'lib/flightstats/flight_status.rb', line 3 def status @status end |
Class Method Details
.arriving_on(carrier, flight_number, year, month, day, options = {}) ⇒ Object
29 30 31 |
# File 'lib/flightstats/flight_status.rb', line 29 def arriving_on(carrier, flight_number, year, month, day, = {}) from_response API.get("#{base_path}/flight/status/#{carrier}/#{flight_number}/arr/#{year}/#{month}/#{day}", {}, ), 'flightStatuses' end |
.base_path ⇒ Object
45 46 47 |
# File 'lib/flightstats/flight_status.rb', line 45 def base_path @@base_path end |
.by_flight_id(flight_id, options = {}) ⇒ Object
21 22 23 |
# File 'lib/flightstats/flight_status.rb', line 21 def by_flight_id(flight_id, = {}) from_response API.get("#{base_path}/flight/status/#{flight_id}", {}, ), 'flightStatus' end |
.departing_on(carrier, flight_number, year, month, day, options = {}) ⇒ Object
25 26 27 |
# File 'lib/flightstats/flight_status.rb', line 25 def departing_on(carrier, flight_number, year, month, day, = {}) from_response API.get("#{base_path}/flight/status/#{carrier}/#{flight_number}/dep/#{year}/#{month}/#{day}", {}, ), 'flightStatuses' end |
.track_arriving_on(carrier, flight_number, year, month, day, options = {}) ⇒ Object
37 38 39 |
# File 'lib/flightstats/flight_status.rb', line 37 def track_arriving_on(carrier, flight_number, year, month, day, = {}) from_response API.get("#{base_path}/flight/tracks/#{carrier}/#{flight_number}/arr/#{year}/#{month}/#{day}", {}, ), 'flightTracks' end |
.track_by_flight_id(flight_id, options = {}) ⇒ Object
33 34 35 |
# File 'lib/flightstats/flight_status.rb', line 33 def track_by_flight_id(flight_id, = {}) from_response API.get("#{base_path}/flight/track/#{flight_id}", {}, ), 'flightTrack' end |
.track_departing_on(carrier, flight_number, year, month, day, options = {}) ⇒ Object
41 42 43 |
# File 'lib/flightstats/flight_status.rb', line 41 def track_departing_on(carrier, flight_number, year, month, day, = {}) from_response API.get("#{base_path}/flight/tracks/#{carrier}/#{flight_number}/dep/#{year}/#{month}/#{day}", {}, ), 'flightTracks' end |