Class: Weather::Wind
- Inherits:
-
Object
- Object
- Weather::Wind
- Defined in:
- lib/weather-api/wind.rb
Instance Attribute Summary collapse
-
#chill ⇒ Object
readonly
the temperature, with wind chill factored in.
-
#direction ⇒ Object
readonly
the direction of the wind in degrees.
-
#speed ⇒ Object
readonly
the windspeed.
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/weather-api/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, with wind chill factored in
4 5 6 |
# File 'lib/weather-api/wind.rb', line 4 def chill @chill end |
#direction ⇒ Object (readonly)
the direction of the wind in degrees
7 8 9 |
# File 'lib/weather-api/wind.rb', line 7 def direction @direction end |
#speed ⇒ Object (readonly)
the windspeed
10 11 12 |
# File 'lib/weather-api/wind.rb', line 10 def speed @speed end |