Class: OpenWeather::Models::OneCall::HourlyWeather

Inherits:
Model
  • Object
show all
Defined in:
lib/open_weather/models/one_call/hourly_weather.rb

Instance Attribute Summary

Attributes inherited from Model

#options

Instance Method Summary collapse

Methods inherited from Model

#units

Constructor Details

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

Returns a new instance of HourlyWeather.



22
23
24
25
26
27
28
# File 'lib/open_weather/models/one_call/hourly_weather.rb', line 22

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

  self.rain = OpenWeather::Models::Rain.new(rain, options) if rain
  self.snow = OpenWeather::Models::Snow.new(snow, options) if snow
  self.weather = weather.map { |i| OpenWeather::Models::Weather.new(i, options) } if weather
end