Class: YahooWeather::Atmosphere
- Inherits:
-
Object
- Object
- YahooWeather::Atmosphere
- Defined in:
- lib/yahoo-weather.rb
Overview
Describes the specific atmospheric conditions at a location.
Instance Attribute Summary collapse
-
#humidity ⇒ Object
readonly
the humidity of the surroundings.
-
#pressure ⇒ Object
readonly
the pressure level of the surroundings.
-
#rising ⇒ Object
readonly
whether the air currents are rising.
-
#visibility ⇒ Object
readonly
the visibility level of the surroundings.
Instance Method Summary collapse
-
#initialize(payload) ⇒ Atmosphere
constructor
A new instance of Atmosphere.
Constructor Details
#initialize(payload) ⇒ Atmosphere
Returns a new instance of Atmosphere.
112 113 114 115 116 117 |
# File 'lib/yahoo-weather.rb', line 112 def initialize (payload) @humidity = payload['humidity'].to_i @visibility = payload['visibility'].to_i @pressure = payload['pressure'].to_f @rising = (payload['rising'] == "1") end |
Instance Attribute Details
#humidity ⇒ Object (readonly)
the humidity of the surroundings.
101 102 103 |
# File 'lib/yahoo-weather.rb', line 101 def humidity @humidity end |
#pressure ⇒ Object (readonly)
the pressure level of the surroundings.
107 108 109 |
# File 'lib/yahoo-weather.rb', line 107 def pressure @pressure end |
#rising ⇒ Object (readonly)
whether the air currents are rising.
110 111 112 |
# File 'lib/yahoo-weather.rb', line 110 def rising @rising end |
#visibility ⇒ Object (readonly)
the visibility level of the surroundings
104 105 106 |
# File 'lib/yahoo-weather.rb', line 104 def visibility @visibility end |