Class: Weather
- Inherits:
-
Object
- Object
- Weather
- Defined in:
- lib/weather_usa/weather.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#current ⇒ Object
Returns the value of attribute current.
-
#detailed_forecast ⇒ Object
Returns the value of attribute detailed_forecast.
-
#is_daytime ⇒ Object
Returns the value of attribute is_daytime.
-
#name ⇒ Object
Returns the value of attribute name.
-
#number ⇒ Object
Returns the value of attribute number.
-
#short_forecast ⇒ Object
Returns the value of attribute short_forecast.
-
#temperature ⇒ Object
Returns the value of attribute temperature.
-
#wind_direction ⇒ Object
Returns the value of attribute wind_direction.
-
#wind_speed ⇒ Object
Returns the value of attribute wind_speed.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(weather_hash) ⇒ Weather
constructor
A new instance of Weather.
Constructor Details
#initialize(weather_hash) ⇒ Weather
Returns a new instance of Weather.
7 8 9 10 11 12 |
# File 'lib/weather_usa/weather.rb', line 7 def initialize(weather_hash) weather_hash.each do |k, v| self.send "#{k}=", v end @@all << self end |
Instance Attribute Details
#current ⇒ Object
Returns the value of attribute current.
2 3 4 |
# File 'lib/weather_usa/weather.rb', line 2 def current @current end |
#detailed_forecast ⇒ Object
Returns the value of attribute detailed_forecast.
2 3 4 |
# File 'lib/weather_usa/weather.rb', line 2 def detailed_forecast @detailed_forecast end |
#is_daytime ⇒ Object
Returns the value of attribute is_daytime.
2 3 4 |
# File 'lib/weather_usa/weather.rb', line 2 def is_daytime @is_daytime end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/weather_usa/weather.rb', line 2 def name @name end |
#number ⇒ Object
Returns the value of attribute number.
2 3 4 |
# File 'lib/weather_usa/weather.rb', line 2 def number @number end |
#short_forecast ⇒ Object
Returns the value of attribute short_forecast.
2 3 4 |
# File 'lib/weather_usa/weather.rb', line 2 def short_forecast @short_forecast end |
#temperature ⇒ Object
Returns the value of attribute temperature.
2 3 4 |
# File 'lib/weather_usa/weather.rb', line 2 def temperature @temperature end |
#wind_direction ⇒ Object
Returns the value of attribute wind_direction.
2 3 4 |
# File 'lib/weather_usa/weather.rb', line 2 def wind_direction @wind_direction end |
#wind_speed ⇒ Object
Returns the value of attribute wind_speed.
2 3 4 |
# File 'lib/weather_usa/weather.rb', line 2 def wind_speed @wind_speed end |
Class Method Details
.all ⇒ Object
14 15 16 |
# File 'lib/weather_usa/weather.rb', line 14 def self.all @@all end |
.clear_all ⇒ Object
18 19 20 |
# File 'lib/weather_usa/weather.rb', line 18 def self.clear_all @@all = [] end |