Class: Waqi::Client
- Inherits:
-
Object
- Object
- Waqi::Client
- Includes:
- Resource::CityFeed, Resource::HttpRequest
- Defined in:
- lib/waqi/client.rb
Constant Summary collapse
- BASE_URL =
'https://api.waqi.info/'
Instance Attribute Summary collapse
-
#adapter ⇒ Object
readonly
Returns the value of attribute adapter.
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
Instance Method Summary collapse
-
#initialize(api_key:, adapter: Faraday.default_adapter) ⇒ Client
constructor
A new instance of Client.
Methods included from Resource::HttpRequest
Methods included from Resource::CityFeed
#get_city_feed, #get_geo_feed, #get_geo_feed_by_ip, #map_station, #search_station
Constructor Details
#initialize(api_key:, adapter: Faraday.default_adapter) ⇒ Client
Returns a new instance of Client.
15 16 17 18 19 |
# File 'lib/waqi/client.rb', line 15 def initialize(api_key:, adapter: Faraday.default_adapter) @api_key = api_key @adapter = adapter connection end |
Instance Attribute Details
#adapter ⇒ Object (readonly)
Returns the value of attribute adapter.
13 14 15 |
# File 'lib/waqi/client.rb', line 13 def adapter @adapter end |
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
13 14 15 |
# File 'lib/waqi/client.rb', line 13 def api_key @api_key end |