Class: OpenWeather::Models::Forecast::Hourly

Inherits:
Model
  • Object
show all
Includes:
Enumerable
Defined in:
lib/open_weather/models/forecast/hourly.rb

Instance Attribute Summary

Attributes inherited from Model

#options

Instance Method Summary collapse

Methods inherited from Model

#units

Constructor Details

#initialize(args = nil, options = {}) ⇒ Hourly

Returns a new instance of Hourly.



16
17
18
19
20
21
# File 'lib/open_weather/models/forecast/hourly.rb', line 16

def initialize(args = nil, options = {})
  super args, options

  self.list = list.map { |forecast| OpenWeather::Models::Forecast::Forecast.new(forecast, options) } if list
  self.city = OpenWeather::Models::Forecast::City.new(city, options) if city
end