Class: OpenWeather::Models::OneCall::Weather
- Defined in:
- lib/open_weather/models/one_call/weather.rb
Instance Attribute Summary
Attributes inherited from Model
Instance Method Summary collapse
-
#initialize(args = nil, options = {}) ⇒ Weather
constructor
A new instance of Weather.
Methods inherited from Model
Constructor Details
#initialize(args = nil, options = {}) ⇒ Weather
Returns a new instance of Weather.
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/open_weather/models/one_call/weather.rb', line 17 def initialize(args = nil, = {}) super args, self.current = OpenWeather::Models::OneCall::CurrentWeather.new(current, ) if current self.data = data.map { |i| OpenWeather::Models::OneCall::CurrentWeather.new(i, ) } if data self.minutely = minutely.map { |i| OpenWeather::Models::OneCall::MinutelyWeather.new(i, ) } if minutely self.hourly = hourly.map { |i| OpenWeather::Models::OneCall::HourlyWeather.new(i, ) } if hourly self.daily = daily.map { |i| OpenWeather::Models::OneCall::DailyWeather.new(i, ) } if daily self.alerts = alerts.map { |i| OpenWeather::Models::OneCall::Alert.new(i, ) } if alerts end |