Class: IqairAirvisual::Client
- Inherits:
-
Object
- Object
- IqairAirvisual::Client
- Defined in:
- lib/iqair_airvisual/client.rb
Constant Summary
Constants included from Constants
IqairAirvisual::Constants::AQI_INDEX, IqairAirvisual::Constants::BASE_PATH, IqairAirvisual::Constants::IMAGES_PATH, IqairAirvisual::Constants::UNITS, IqairAirvisual::Constants::WEATHER_CODES, IqairAirvisual::Constants::WEATHER_ICON_INDEX
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
TODO: Air quality guidelines TODO: Units breakdown TODO: Return codes api-docs.iqair.com/?version=latest Below are a few example of return codes you may get.
-
#base_path ⇒ Object
readonly
TODO: Air quality guidelines TODO: Units breakdown TODO: Return codes api-docs.iqair.com/?version=latest Below are a few example of return codes you may get.
-
#expiry ⇒ Object
readonly
TODO: Air quality guidelines TODO: Units breakdown TODO: Return codes api-docs.iqair.com/?version=latest Below are a few example of return codes you may get.
-
#login_response ⇒ Object
readonly
TODO: Air quality guidelines TODO: Units breakdown TODO: Return codes api-docs.iqair.com/?version=latest Below are a few example of return codes you may get.
-
#port ⇒ Object
readonly
TODO: Air quality guidelines TODO: Units breakdown TODO: Return codes api-docs.iqair.com/?version=latest Below are a few example of return codes you may get.
-
#raw_cookie ⇒ Object
readonly
TODO: Air quality guidelines TODO: Units breakdown TODO: Return codes api-docs.iqair.com/?version=latest Below are a few example of return codes you may get.
Class Method Summary collapse
-
.api_version ⇒ Object
This is the version of the API docs this client was built off-of.
- .compatible_api_version ⇒ Object
Instance Method Summary collapse
-
#initialize(api_key:, base_path: BASE_PATH, port: 80) ⇒ Client
constructor
A new instance of Client.
Methods included from Community
#cities, #city, #countries, #nearest_city, #states
Methods included from Constants
Constructor Details
#initialize(api_key:, base_path: BASE_PATH, port: 80) ⇒ Client
Returns a new instance of Client.
27 28 29 30 31 |
# File 'lib/iqair_airvisual/client.rb', line 27 def initialize(api_key:, base_path: BASE_PATH, port: 80) @api_key = api_key @base_path = base_path @port = port end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
TODO: Air quality guidelines TODO: Units breakdown TODO: Return codes api-docs.iqair.com/?version=latest Below are a few example of return codes you may get. This list is not exhaustive. success: returned when JSON file was generated successfully. call_limit_reached: returned when minute/monthly limit is reached. api_key_expired: returned when API key is expired. incorrect_api_key: returned when using wrong API key. ip_location_failed: returned when service is unable to locate IP address of request. no_nearest_station: returned when there is no nearest station within specified radius. feature_not_available: returned when call requests a feature that is not available in chosen subscription plan. too_many_requests: returned when more than 10 calls per second are made.
20 21 22 |
# File 'lib/iqair_airvisual/client.rb', line 20 def api_key @api_key end |
#base_path ⇒ Object (readonly)
TODO: Air quality guidelines TODO: Units breakdown TODO: Return codes api-docs.iqair.com/?version=latest Below are a few example of return codes you may get. This list is not exhaustive. success: returned when JSON file was generated successfully. call_limit_reached: returned when minute/monthly limit is reached. api_key_expired: returned when API key is expired. incorrect_api_key: returned when using wrong API key. ip_location_failed: returned when service is unable to locate IP address of request. no_nearest_station: returned when there is no nearest station within specified radius. feature_not_available: returned when call requests a feature that is not available in chosen subscription plan. too_many_requests: returned when more than 10 calls per second are made.
20 21 22 |
# File 'lib/iqair_airvisual/client.rb', line 20 def base_path @base_path end |
#expiry ⇒ Object (readonly)
TODO: Air quality guidelines TODO: Units breakdown TODO: Return codes api-docs.iqair.com/?version=latest Below are a few example of return codes you may get. This list is not exhaustive. success: returned when JSON file was generated successfully. call_limit_reached: returned when minute/monthly limit is reached. api_key_expired: returned when API key is expired. incorrect_api_key: returned when using wrong API key. ip_location_failed: returned when service is unable to locate IP address of request. no_nearest_station: returned when there is no nearest station within specified radius. feature_not_available: returned when call requests a feature that is not available in chosen subscription plan. too_many_requests: returned when more than 10 calls per second are made.
20 21 22 |
# File 'lib/iqair_airvisual/client.rb', line 20 def expiry @expiry end |
#login_response ⇒ Object (readonly)
TODO: Air quality guidelines TODO: Units breakdown TODO: Return codes api-docs.iqair.com/?version=latest Below are a few example of return codes you may get. This list is not exhaustive. success: returned when JSON file was generated successfully. call_limit_reached: returned when minute/monthly limit is reached. api_key_expired: returned when API key is expired. incorrect_api_key: returned when using wrong API key. ip_location_failed: returned when service is unable to locate IP address of request. no_nearest_station: returned when there is no nearest station within specified radius. feature_not_available: returned when call requests a feature that is not available in chosen subscription plan. too_many_requests: returned when more than 10 calls per second are made.
20 21 22 |
# File 'lib/iqair_airvisual/client.rb', line 20 def login_response @login_response end |
#port ⇒ Object (readonly)
TODO: Air quality guidelines TODO: Units breakdown TODO: Return codes api-docs.iqair.com/?version=latest Below are a few example of return codes you may get. This list is not exhaustive. success: returned when JSON file was generated successfully. call_limit_reached: returned when minute/monthly limit is reached. api_key_expired: returned when API key is expired. incorrect_api_key: returned when using wrong API key. ip_location_failed: returned when service is unable to locate IP address of request. no_nearest_station: returned when there is no nearest station within specified radius. feature_not_available: returned when call requests a feature that is not available in chosen subscription plan. too_many_requests: returned when more than 10 calls per second are made.
20 21 22 |
# File 'lib/iqair_airvisual/client.rb', line 20 def port @port end |
#raw_cookie ⇒ Object (readonly)
TODO: Air quality guidelines TODO: Units breakdown TODO: Return codes api-docs.iqair.com/?version=latest Below are a few example of return codes you may get. This list is not exhaustive. success: returned when JSON file was generated successfully. call_limit_reached: returned when minute/monthly limit is reached. api_key_expired: returned when API key is expired. incorrect_api_key: returned when using wrong API key. ip_location_failed: returned when service is unable to locate IP address of request. no_nearest_station: returned when there is no nearest station within specified radius. feature_not_available: returned when call requests a feature that is not available in chosen subscription plan. too_many_requests: returned when more than 10 calls per second are made.
20 21 22 |
# File 'lib/iqair_airvisual/client.rb', line 20 def end |
Class Method Details
.api_version ⇒ Object
This is the version of the API docs this client was built off-of
38 39 40 |
# File 'lib/iqair_airvisual/client.rb', line 38 def self.api_version 'v2 2021-04-18' end |
.compatible_api_version ⇒ Object
33 34 35 |
# File 'lib/iqair_airvisual/client.rb', line 33 def self.compatible_api_version 'v2' end |