Class: Apis::Weather
- Inherits:
-
Object
- Object
- Apis::Weather
- Defined in:
- lib/apis/endpoints/weather.rb
Overview
Class to fetch weather
Instance Method Summary collapse
-
#forecasts(stations, lang = 'is') ⇒ Faraday::Response
Get weather forecast for Iceland.
-
#observations(stations, lang = 'is', time = '1h', anytime = '0') ⇒ Faraday::Response
Get weather observations for Iceland.
-
#texts(types) ⇒ Faraday::Response
Get weather information texts for Iceland.
Instance Method Details
#forecasts(stations, lang = 'is') ⇒ Faraday::Response
Get weather forecast for Iceland.
11 12 13 14 |
# File 'lib/apis/endpoints/weather.rb', line 11 def forecasts(stations, lang = 'is') Apis.client.get("/weather/forecasts/#{lang}" \ "/?stations=#{stations.join(',')}") end |
#observations(stations, lang = 'is', time = '1h', anytime = '0') ⇒ Faraday::Response
Get weather observations for Iceland.
or 3h for mixed data (optional)
24 25 26 27 |
# File 'lib/apis/endpoints/weather.rb', line 24 def observations(stations, lang = 'is', time = '1h', anytime = '0') Apis.client.get("/weather/forecasts/#{lang}" \ "/?stations=#{stations.join(',')}&time=#{time}&anytime=#{anytime}") end |