class Apis::Weather

Class to fetch weather

Public Instance Methods

forecasts(stations, lang = 'is') click to toggle source

Get weather forecast for Iceland.

@param stations [Array] list of stations (required) @param lang [String] result language (optional) @return [Faraday::Response] Api result.

# 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') click to toggle source

Get weather observations for Iceland.

@param stations [Array] list of stations (required) @param lang [String] result language (optional) @param time [String] 1h for automatic stations or 3h for mixed data (optional) @param anytime [String] (optional) @return [Faraday::Response] Api result.

# 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
texts(types) click to toggle source

Get weather information texts for Iceland.

@param types [Array] list of types (required) @return [Faraday::Response] Api result.

# File lib/apis/endpoints/weather.rb, line 33
def texts(types)
  Apis.client.get("/weather/texts?types=#{types.join(',')}")
end