Class: YahooWeather::Wind
- Inherits:
-
Object
- Object
- YahooWeather::Wind
- Defined in:
- lib/yahoo-weather/wind.rb
Overview
Describes the specific wind conditions at a location.
Instance Attribute Summary collapse
-
#chill ⇒ Object
readonly
the temperature factoring in wind chill.
-
#direction ⇒ Object
readonly
the direction of the wind in degrees.
-
#speed ⇒ Object
readonly
the speed of the wind.
Instance Method Summary collapse
-
#initialize(payload) ⇒ Wind
constructor
A new instance of Wind.
Constructor Details
#initialize(payload) ⇒ Wind
Returns a new instance of Wind.
12 13 14 15 16 |
# File 'lib/yahoo-weather/wind.rb', line 12 def initialize (payload) @chill = payload['chill'].to_i @direction = payload['direction'].to_i @speed = payload['speed'].to_i end |
Instance Attribute Details
#chill ⇒ Object (readonly)
the temperature factoring in wind chill.
4 5 6 |
# File 'lib/yahoo-weather/wind.rb', line 4 def chill @chill end |
#direction ⇒ Object (readonly)
the direction of the wind in degrees.
7 8 9 |
# File 'lib/yahoo-weather/wind.rb', line 7 def direction @direction end |
#speed ⇒ Object (readonly)
the speed of the wind.
10 11 12 |
# File 'lib/yahoo-weather/wind.rb', line 10 def speed @speed end |