Module: Waqi::Resource::CityFeed
- Included in:
- Client
- Defined in:
- lib/waqi/resources/city_feed.rb
Overview
For more information, visit aqicn.org/json-api/doc
Instance Method Summary collapse
-
#get_city_feed(city) ⇒ Hash, string
@pathparams:.
-
#get_geo_feed(lat:, lng:) ⇒ Hash, string
Get gelocalized feed based on lat/lng based.
-
#get_geo_feed_by_ip ⇒ Hash, string
Get gelocalized feed based on user’s ip address.
-
#map_station(latlng:, networks: 'all') ⇒ Hash, string
Get gelocalized feed based on user’s ip address.
-
#search_station(name) ⇒ Hash, string
Search station by name.
Instance Method Details
#get_city_feed(city) ⇒ Hash, string
@pathparams:
16 17 18 |
# File 'lib/waqi/resources/city_feed.rb', line 16 def get_city_feed(city) get("/feed/#{city}") end |
#get_geo_feed(lat:, lng:) ⇒ Hash, string
Get gelocalized feed based on lat/lng based
@pathparams:
28 29 30 |
# File 'lib/waqi/resources/city_feed.rb', line 28 def get_geo_feed(lat:, lng:) get("/feed/geo:#{lat};#{lng}") end |
#get_geo_feed_by_ip ⇒ Hash, string
Get gelocalized feed based on user’s ip address
36 37 38 |
# File 'lib/waqi/resources/city_feed.rb', line 36 def get_geo_feed_by_ip get("/feed/here") end |
#map_station(latlng:, networks: 'all') ⇒ Hash, string
Get gelocalized feed based on user’s ip address
@queryParams:
48 49 50 51 52 53 54 |
# File 'lib/waqi/resources/city_feed.rb', line 48 def map_station(latlng:, networks: 'all') raise Waqi::Errors::ArgumentError.new("latlng params cannot be empty") if latlng.empty? formattedLatLng = latlng.join(',') get("/map/bounds", params: { latlng: formattedLatLng, networks: networks }) end |
#search_station(name) ⇒ Hash, string
Search station by name
@queryParams:
63 64 65 |
# File 'lib/waqi/resources/city_feed.rb', line 63 def search_station(name) get("/search/", params: { keyword: name }) end |