Class: OpenWeather::Models::OneCall::Weather

Inherits:
Model
  • Object
show all
Defined in:
lib/open_weather/models/one_call/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 = {}) ⇒ Weather

Returns a new instance of Weather.



16
17
18
19
20
21
22
23
24
# File 'lib/open_weather/models/one_call/weather.rb', line 16

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

  self.current = OpenWeather::Models::OneCall::CurrentWeather.new(current, options) if current
  self.minutely = minutely.map { |i| OpenWeather::Models::OneCall::MinutelyWeather.new(i, options) } if minutely
  self.hourly = hourly.map { |i| OpenWeather::Models::OneCall::HourlyWeather.new(i, options) } if hourly
  self.daily = daily.map { |i| OpenWeather::Models::OneCall::DailyWeather.new(i, options) } if daily
  self.alerts = alerts.map { |i| OpenWeather::Models::OneCall::Alert.new(i, options) } if alerts
end