Class: Yweather::Units
- Inherits:
-
Object
- Object
- Yweather::Units
- Defined in:
- lib/yweather/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(data) ⇒ Units
constructor
A new instance of Units.
Constructor Details
#initialize(data) ⇒ Units
Returns a new instance of Units.
12 13 14 15 16 17 |
# File 'lib/yweather/units.rb', line 12 def initialize(data) @temperature = data[:temperature] @distance = data[:distance] @pressure = data[:pressure] @speed = data[:speed] end |
Instance Attribute Details
#distance ⇒ Object (readonly)
Returns the value of attribute distance.
8 9 10 |
# File 'lib/yweather/units.rb', line 8 def distance @distance end |
#pressure ⇒ Object (readonly)
Returns the value of attribute pressure.
9 10 11 |
# File 'lib/yweather/units.rb', line 9 def pressure @pressure end |
#speed ⇒ Object (readonly)
Returns the value of attribute speed.
10 11 12 |
# File 'lib/yweather/units.rb', line 10 def speed @speed end |
#temperature ⇒ Object (readonly)
Returns the value of attribute temperature.
7 8 9 |
# File 'lib/yweather/units.rb', line 7 def temperature @temperature end |