Class: FlightStats::Airport
- Defined in:
- lib/flightstats/airport.rb
Constant Summary collapse
- @@base_path =
"/flex/airports/rest/v1/json"
Instance Attribute Summary collapse
-
#active ⇒ Object
Returns the value of attribute active.
-
#city ⇒ Object
Returns the value of attribute city.
-
#city_code ⇒ Object
Returns the value of attribute city_code.
-
#classification ⇒ Object
Returns the value of attribute classification.
-
#country_code ⇒ Object
Returns the value of attribute country_code.
-
#country_name ⇒ Object
Returns the value of attribute country_name.
-
#delay_index_url ⇒ Object
Returns the value of attribute delay_index_url.
-
#elevation_feet ⇒ Object
Returns the value of attribute elevation_feet.
-
#faa ⇒ Object
Returns the value of attribute faa.
-
#fs ⇒ Object
Returns the value of attribute fs.
-
#iata ⇒ Object
Returns the value of attribute iata.
-
#icao ⇒ Object
Returns the value of attribute icao.
-
#latitude ⇒ Object
Returns the value of attribute latitude.
-
#local_time ⇒ Object
Returns the value of attribute local_time.
-
#longitude ⇒ Object
Returns the value of attribute longitude.
-
#name ⇒ Object
Returns the value of attribute name.
-
#postal_code ⇒ Object
Returns the value of attribute postal_code.
-
#region_name ⇒ Object
Returns the value of attribute region_name.
-
#state_code ⇒ Object
Returns the value of attribute state_code.
-
#street1 ⇒ Object
Returns the value of attribute street1.
-
#time_zone_region_name ⇒ Object
Returns the value of attribute time_zone_region_name.
-
#utc_offset_hours ⇒ Object
Returns the value of attribute utc_offset_hours.
-
#weather_url ⇒ Object
Returns the value of attribute weather_url.
-
#weather_zone ⇒ Object
Returns the value of attribute weather_zone.
Attributes inherited from Resource
#attributes, #etag, #response, #uri
Class Method Summary collapse
- .actives(options = {}) ⇒ Object
- .actives_for_date(year, month, day, options = {}) ⇒ Object
- .all(options = {}) ⇒ Object
- .base_path ⇒ Object
- .by_city_code(city_code, options = {}) ⇒ Object
- .by_country_code(country_code, options = {}) ⇒ Object
- .by_flight_stats_code(flight_stats_code, options = {}) ⇒ Object
- .by_iata_code(iata_code, options = {}) ⇒ Object
- .by_iata_code_on_date(iata_code, year, month, day, options = {}) ⇒ Object
- .by_icao_code(icao_code, options = {}) ⇒ Object
- .by_icao_code_on_date(icao_code, year, month, day, options = {}) ⇒ Object
- .current(code, options = {}) ⇒ Object
- .on_date(code, year, month, day, options = {}) ⇒ Object
- .within_radius(longitude, latitude, radius_miles, 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
#active ⇒ Object
Returns the value of attribute active.
3 4 5 |
# File 'lib/flightstats/airport.rb', line 3 def active @active end |
#city ⇒ Object
Returns the value of attribute city.
3 4 5 |
# File 'lib/flightstats/airport.rb', line 3 def city @city end |
#city_code ⇒ Object
Returns the value of attribute city_code.
3 4 5 |
# File 'lib/flightstats/airport.rb', line 3 def city_code @city_code end |
#classification ⇒ Object
Returns the value of attribute classification.
3 4 5 |
# File 'lib/flightstats/airport.rb', line 3 def classification @classification end |
#country_code ⇒ Object
Returns the value of attribute country_code.
3 4 5 |
# File 'lib/flightstats/airport.rb', line 3 def country_code @country_code end |
#country_name ⇒ Object
Returns the value of attribute country_name.
3 4 5 |
# File 'lib/flightstats/airport.rb', line 3 def country_name @country_name end |
#delay_index_url ⇒ Object
Returns the value of attribute delay_index_url.
3 4 5 |
# File 'lib/flightstats/airport.rb', line 3 def delay_index_url @delay_index_url end |
#elevation_feet ⇒ Object
Returns the value of attribute elevation_feet.
3 4 5 |
# File 'lib/flightstats/airport.rb', line 3 def elevation_feet @elevation_feet end |
#faa ⇒ Object
Returns the value of attribute faa.
3 4 5 |
# File 'lib/flightstats/airport.rb', line 3 def faa @faa end |
#fs ⇒ Object
Returns the value of attribute fs.
3 4 5 |
# File 'lib/flightstats/airport.rb', line 3 def fs @fs end |
#iata ⇒ Object
Returns the value of attribute iata.
3 4 5 |
# File 'lib/flightstats/airport.rb', line 3 def iata @iata end |
#icao ⇒ Object
Returns the value of attribute icao.
3 4 5 |
# File 'lib/flightstats/airport.rb', line 3 def icao @icao end |
#latitude ⇒ Object
Returns the value of attribute latitude.
3 4 5 |
# File 'lib/flightstats/airport.rb', line 3 def latitude @latitude end |
#local_time ⇒ Object
Returns the value of attribute local_time.
3 4 5 |
# File 'lib/flightstats/airport.rb', line 3 def local_time @local_time end |
#longitude ⇒ Object
Returns the value of attribute longitude.
3 4 5 |
# File 'lib/flightstats/airport.rb', line 3 def longitude @longitude end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/flightstats/airport.rb', line 3 def name @name end |
#postal_code ⇒ Object
Returns the value of attribute postal_code.
3 4 5 |
# File 'lib/flightstats/airport.rb', line 3 def postal_code @postal_code end |
#region_name ⇒ Object
Returns the value of attribute region_name.
3 4 5 |
# File 'lib/flightstats/airport.rb', line 3 def region_name @region_name end |
#state_code ⇒ Object
Returns the value of attribute state_code.
3 4 5 |
# File 'lib/flightstats/airport.rb', line 3 def state_code @state_code end |
#street1 ⇒ Object
Returns the value of attribute street1.
3 4 5 |
# File 'lib/flightstats/airport.rb', line 3 def street1 @street1 end |
#time_zone_region_name ⇒ Object
Returns the value of attribute time_zone_region_name.
3 4 5 |
# File 'lib/flightstats/airport.rb', line 3 def time_zone_region_name @time_zone_region_name end |
#utc_offset_hours ⇒ Object
Returns the value of attribute utc_offset_hours.
3 4 5 |
# File 'lib/flightstats/airport.rb', line 3 def utc_offset_hours @utc_offset_hours end |
#weather_url ⇒ Object
Returns the value of attribute weather_url.
3 4 5 |
# File 'lib/flightstats/airport.rb', line 3 def weather_url @weather_url end |
#weather_zone ⇒ Object
Returns the value of attribute weather_zone.
3 4 5 |
# File 'lib/flightstats/airport.rb', line 3 def weather_zone @weather_zone end |
Class Method Details
.actives(options = {}) ⇒ Object
31 32 33 |
# File 'lib/flightstats/airport.rb', line 31 def actives( = {}) from_response API.get("#{base_path}/active", {}, ), 'airports' end |
.actives_for_date(year, month, day, options = {}) ⇒ Object
35 36 37 |
# File 'lib/flightstats/airport.rb', line 35 def actives_for_date(year, month, day, = {}) from_response API.get("#{base_path}/active/#{year}/#{month}/#{day}", {}, ), 'airports' end |
.all(options = {}) ⇒ Object
39 40 41 |
# File 'lib/flightstats/airport.rb', line 39 def all( = {}) from_response API.get("#{base_path}/all", {}, ), 'airports' end |
.base_path ⇒ Object
83 84 85 |
# File 'lib/flightstats/airport.rb', line 83 def base_path @@base_path end |
.by_city_code(city_code, options = {}) ⇒ Object
51 52 53 |
# File 'lib/flightstats/airport.rb', line 51 def by_city_code(city_code, = {}) from_response API.get("#{base_path}/cityCode/#{city_code}", {}, ), 'airports' end |
.by_country_code(country_code, options = {}) ⇒ Object
55 56 57 |
# File 'lib/flightstats/airport.rb', line 55 def by_country_code(country_code, = {}) from_response API.get("#{base_path}/countryCode/#{country_code}", {}, ), 'airports' end |
.by_flight_stats_code(flight_stats_code, options = {}) ⇒ Object
59 60 61 |
# File 'lib/flightstats/airport.rb', line 59 def by_flight_stats_code(flight_stats_code, = {}) from_response API.get("#{base_path}/fs/#{flight_stats_code}", {}, ), 'airport' end |
.by_iata_code(iata_code, options = {}) ⇒ Object
63 64 65 |
# File 'lib/flightstats/airport.rb', line 63 def by_iata_code(iata_code, = {}) from_response API.get("#{base_path}/iata/#{iata_code}", {}, ), 'airports' end |
.by_iata_code_on_date(iata_code, year, month, day, options = {}) ⇒ Object
67 68 69 |
# File 'lib/flightstats/airport.rb', line 67 def by_iata_code_on_date(iata_code, year, month, day, = {}) from_response API.get("#{base_path}/iata/#{iata_code}/#{year}/#{month}/#{day}", {}, ), 'airport' end |
.by_icao_code(icao_code, options = {}) ⇒ Object
71 72 73 |
# File 'lib/flightstats/airport.rb', line 71 def by_icao_code(icao_code, = {}) from_response API.get("#{base_path}/icao/#{icao_code}", {}, ), 'airports' end |
.by_icao_code_on_date(icao_code, year, month, day, options = {}) ⇒ Object
75 76 77 |
# File 'lib/flightstats/airport.rb', line 75 def by_icao_code_on_date(icao_code, year, month, day, = {}) from_response API.get("#{base_path}/icao/#{icao_code}/#{year}/#{month}/#{day}", {}, ), 'airport' end |
.current(code, options = {}) ⇒ Object
43 44 45 |
# File 'lib/flightstats/airport.rb', line 43 def current(code, = {}) from_response API.get("#{base_path}/#{code}/today", {}, ), 'airport' end |