Class: YahooWeather::Units
- Inherits:
-
Object
- Object
- YahooWeather::Units
- Defined in:
- lib/yahoo_weather/units.rb
Constant Summary collapse
- FAHRENHEIT =
'f'
- CELSIUS =
'c'
Instance Attribute Summary collapse
-
#distance ⇒ Object
readonly
Returns the value of attribute distance.
-
#pressure ⇒ Object
readonly
Returns the value of attribute pressure.
-
#speed ⇒ Object
readonly
Returns the value of attribute speed.
-
#temperature ⇒ Object
readonly
Returns the value of attribute temperature.
Instance Method Summary collapse
-
#initialize(payload) ⇒ Units
constructor
A new instance of Units.
Constructor Details
#initialize(payload) ⇒ Units
Returns a new instance of Units.
7 8 9 10 11 12 |
# File 'lib/yahoo_weather/units.rb', line 7 def initialize(payload) @temperature = payload['temperature'] @distance = payload['distance'] @pressure = payload['pressure'] @speed = payload['speed'] end |
Instance Attribute Details
#distance ⇒ Object (readonly)
Returns the value of attribute distance.
5 6 7 |
# File 'lib/yahoo_weather/units.rb', line 5 def distance @distance end |
#pressure ⇒ Object (readonly)
Returns the value of attribute pressure.
5 6 7 |
# File 'lib/yahoo_weather/units.rb', line 5 def pressure @pressure end |
#speed ⇒ Object (readonly)
Returns the value of attribute speed.
5 6 7 |
# File 'lib/yahoo_weather/units.rb', line 5 def speed @speed end |
#temperature ⇒ Object (readonly)
Returns the value of attribute temperature.
5 6 7 |
# File 'lib/yahoo_weather/units.rb', line 5 def temperature @temperature end |