Class: Forecastr::Wind
- Inherits:
-
Object
- Object
- Forecastr::Wind
- Defined in:
- lib/forecastr/wind.rb
Constant Summary collapse
- DIRECTIONS =
["N","NNE","NE","ENE","E","ESE", "SE", "SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"]
Instance Attribute Summary collapse
-
#direction ⇒ Object
readonly
Returns the value of attribute direction.
-
#speed ⇒ Object
readonly
Returns the value of attribute speed.
Instance Method Summary collapse
-
#initialize(speed, angle) ⇒ Wind
constructor
A new instance of Wind.
- #to_s ⇒ Object
Constructor Details
#initialize(speed, angle) ⇒ Wind
Returns a new instance of Wind.
7 8 9 10 |
# File 'lib/forecastr/wind.rb', line 7 def initialize(speed, angle) @speed = speed @angle = angle end |
Instance Attribute Details
#direction ⇒ Object (readonly)
Returns the value of attribute direction.
5 6 7 |
# File 'lib/forecastr/wind.rb', line 5 def direction @direction end |
#speed ⇒ Object (readonly)
Returns the value of attribute speed.
5 6 7 |
# File 'lib/forecastr/wind.rb', line 5 def speed @speed end |
Instance Method Details
#to_s ⇒ Object
21 22 23 |
# File 'lib/forecastr/wind.rb', line 21 def to_s "#{speed} #{direction}" end |