Module: OpenWeather::Endpoints::Hourly

Included in:
Client
Defined in:
lib/open_weather/endpoints/hourly.rb

Instance Method Summary collapse

Instance Method Details

#hourly(lat, lon = nil, options = {}) ⇒ Object



6
7
8
9
10
11
12
13
# File 'lib/open_weather/endpoints/hourly.rb', line 6

def hourly(lat, lon = nil, options = {})
  # default to the pro endpoint if not specified
  endpoint = options.delete(:endpoint) || pro_endpoint
  options = options.merge(endpoint: endpoint)

  options = lat.is_a?(Hash) ? options.merge(lat) : options.merge(lat: lat, lon: lon)
  OpenWeather::Models::Forecast::Hourly.new(get('2.5/forecast/hourly', options), options)
end