Class: OpenWeather::Models::City::Weather

Inherits:
Model
  • Object
show all
Defined in:
lib/open_weather/models/city/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.



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/open_weather/models/city/weather.rb', line 23

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

  self.coord = OpenWeather::Models::Coord.new(coord, options) if coord
  self.weather = weather.map { |i| OpenWeather::Models::Weather.new(i, options) } if weather
  self.main = OpenWeather::Models::Main.new(main, options) if main
  self.wind = OpenWeather::Models::Wind.new(wind, options) if wind
  self.clouds = OpenWeather::Models::Clouds.new(clouds, options) if clouds
  self.rain = OpenWeather::Models::Rain.new(rain, options) if rain
  self.snow = OpenWeather::Models::Snow.new(snow, options) if snow
  self.sys = OpenWeather::Models::Sys.new(sys, options) if sys
end