Class: SportsDataApi::Nfl::Weather
- Inherits:
-
Object
- Object
- SportsDataApi::Nfl::Weather
- Defined in:
- lib/sports_data_api/nfl/weather.rb
Instance Attribute Summary collapse
-
#condition ⇒ Object
readonly
Returns the value of attribute condition.
-
#humidity ⇒ Object
readonly
Returns the value of attribute humidity.
-
#temperature ⇒ Object
readonly
Returns the value of attribute temperature.
-
#wind_direction ⇒ Object
readonly
Returns the value of attribute wind_direction.
-
#wind_speed ⇒ Object
readonly
Returns the value of attribute wind_speed.
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.
5 6 7 8 9 10 11 12 13 |
# File 'lib/sports_data_api/nfl/weather.rb', line 5 def initialize(weather_hash) if weather_hash @temperature = weather_hash['temperature'] @condition = weather_hash['condition'] @humidity = weather_hash['humidity'] @wind_speed = weather_hash['wind']['speed'] @wind_direction = weather_hash['wind']['direction'] end end |
Instance Attribute Details
#condition ⇒ Object (readonly)
Returns the value of attribute condition.
4 5 6 |
# File 'lib/sports_data_api/nfl/weather.rb', line 4 def condition @condition end |
#humidity ⇒ Object (readonly)
Returns the value of attribute humidity.
4 5 6 |
# File 'lib/sports_data_api/nfl/weather.rb', line 4 def humidity @humidity end |
#temperature ⇒ Object (readonly)
Returns the value of attribute temperature.
4 5 6 |
# File 'lib/sports_data_api/nfl/weather.rb', line 4 def temperature @temperature end |
#wind_direction ⇒ Object (readonly)
Returns the value of attribute wind_direction.
4 5 6 |
# File 'lib/sports_data_api/nfl/weather.rb', line 4 def wind_direction @wind_direction end |
#wind_speed ⇒ Object (readonly)
Returns the value of attribute wind_speed.
4 5 6 |
# File 'lib/sports_data_api/nfl/weather.rb', line 4 def wind_speed @wind_speed end |