Method: OpenWeatherClient::Weather#get

Defined in:
lib/open_weather_client/weather.rb

#getObject

get the weather according to the specified parameters

Returns:

  • the stored or received data

Raises:

  • (AuthenticationError)

    if the request is not authorized, e.g in case the API key is not correct



41
42
43
44
45
# File 'lib/open_weather_client/weather.rb', line 41

def get
  OpenWeatherClient.cache.get(lat: lat, lon: lon, time: time)
rescue KeyError
  OpenWeatherClient::Request.get(lat: lat, lon: lon, time: time)
end