Class: OpenWeather::Models::City::Weather
- Defined in:
- lib/open_weather/models/city/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.
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, = {}) super args, self.coord = OpenWeather::Models::Coord.new(coord, ) if coord self.weather = weather.map { |i| OpenWeather::Models::Weather.new(i, ) } if weather self.main = OpenWeather::Models::Main.new(main, ) if main self.wind = OpenWeather::Models::Wind.new(wind, ) if wind self.clouds = OpenWeather::Models::Clouds.new(clouds, ) if clouds self.rain = OpenWeather::Models::Rain.new(rain, ) if rain self.snow = OpenWeather::Models::Snow.new(snow, ) if snow self.sys = OpenWeather::Models::Sys.new(sys, ) if sys end |