Class: FlightStats::FlightStatus

Inherits:
Resource
  • Object
show all
Defined in:
lib/flightstats/flight_status.rb

Constant Summary collapse

@@base_path =
"/flex/flightstatus/rest/v2/json"

Instance Attribute Summary collapse

Attributes inherited from Resource

#attributes, #etag, #response, #uri

Class Method Summary collapse

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_resourcesObject

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_codeObject

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_dateObject

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_codeObject

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

#codesharesObject

Returns the value of attribute codeshares.



3
4
5
# File 'lib/flightstats/flight_status.rb', line 3

def codeshares
  @codeshares
end

#departure_airport_fs_codeObject

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_dateObject

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_durationsObject

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_equipmentObject

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_idObject

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_numberObject

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_timesObject

Returns the value of attribute operational_times.



3
4
5
# File 'lib/flightstats/flight_status.rb', line 3

def operational_times
  @operational_times
end

#scheduleObject

Returns the value of attribute schedule.



3
4
5
# File 'lib/flightstats/flight_status.rb', line 3

def schedule
  @schedule
end

#statusObject

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, options = {})
  from_response API.get("#{base_path}/flight/status/#{carrier}/#{flight_number}/arr/#{year}/#{month}/#{day}", {}, options), 'flightStatuses'
end

.base_pathObject



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, options = {})
  from_response API.get("#{base_path}/flight/status/#{flight_id}", {}, options), '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, options = {})
  from_response API.get("#{base_path}/flight/status/#{carrier}/#{flight_number}/dep/#{year}/#{month}/#{day}", {}, options), '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, options = {})
  from_response API.get("#{base_path}/flight/tracks/#{carrier}/#{flight_number}/arr/#{year}/#{month}/#{day}", {}, options), '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, options = {})
  from_response API.get("#{base_path}/flight/track/#{flight_id}", {}, options), '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, options = {})
  from_response API.get("#{base_path}/flight/tracks/#{carrier}/#{flight_number}/dep/#{year}/#{month}/#{day}", {}, options), 'flightTracks'
end