Class: YahooWeather::Units
- Inherits:
-
Object
- Object
- YahooWeather::Units
- Defined in:
- lib/yahoo-weather.rb
Overview
Describes the units of measure with which weather information is provided.
Instance Attribute Summary collapse
-
#distance ⇒ Object
readonly
the units in which distance is measured, e.g.
-
#pressure ⇒ Object
readonly
the units in which pressure is measured, e.g.
-
#speed ⇒ Object
readonly
the units in which speed is measured, e.g.
-
#temperature ⇒ Object
readonly
the units in which temperature is measured, e.g.
Instance Method Summary collapse
-
#initialize(payload) ⇒ Units
constructor
A new instance of Units.
Constructor Details
#initialize(payload) ⇒ Units
Returns a new instance of Units.
72 73 74 75 76 77 |
# File 'lib/yahoo-weather.rb', line 72 def initialize (payload) @temperature = payload['temperature'] @distance = payload['distance'] @pressure = payload['pressure'] @speed = payload['speed'] end |
Instance Attribute Details
#distance ⇒ Object (readonly)
the units in which distance is measured, e.g. mi
for miles
.
64 65 66 |
# File 'lib/yahoo-weather.rb', line 64 def distance @distance end |
#pressure ⇒ Object (readonly)
the units in which pressure is measured, e.g. in
for inches
.
67 68 69 |
# File 'lib/yahoo-weather.rb', line 67 def pressure @pressure end |
#speed ⇒ Object (readonly)
the units in which speed is measured, e.g. mph
for miles per hour
.
70 71 72 |
# File 'lib/yahoo-weather.rb', line 70 def speed @speed end |
#temperature ⇒ Object (readonly)
the units in which temperature is measured, e.g. F
for Fahrenheit
or C
for Celsius
.
61 62 63 |
# File 'lib/yahoo-weather.rb', line 61 def temperature @temperature end |