Class: YahooWeather::Atmosphere

Inherits:
Object
  • Object
show all
Defined in:
lib/yahoo-weather.rb

Overview

Describes the specific atmospheric conditions at a location.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#humidityObject (readonly)

the humidity of the surroundings.



101
102
103
# File 'lib/yahoo-weather.rb', line 101

def humidity
  @humidity
end

#pressureObject (readonly)

the pressure level of the surroundings.



107
108
109
# File 'lib/yahoo-weather.rb', line 107

def pressure
  @pressure
end

#risingObject (readonly)

whether the air currents are rising.



110
111
112
# File 'lib/yahoo-weather.rb', line 110

def rising
  @rising
end

#visibilityObject (readonly)

the visibility level of the surroundings



104
105
106
# File 'lib/yahoo-weather.rb', line 104

def visibility
  @visibility
end