Class: YahooWeather::Units

Inherits:
Object
  • Object
show all
Defined in:
lib/yahoo_weather/units.rb

Constant Summary collapse

FAHRENHEIT =
'f'
CELSIUS =
'c'

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#distanceObject (readonly)

Returns the value of attribute distance.



5
6
7
# File 'lib/yahoo_weather/units.rb', line 5

def distance
  @distance
end

#pressureObject (readonly)

Returns the value of attribute pressure.



5
6
7
# File 'lib/yahoo_weather/units.rb', line 5

def pressure
  @pressure
end

#speedObject (readonly)

Returns the value of attribute speed.



5
6
7
# File 'lib/yahoo_weather/units.rb', line 5

def speed
  @speed
end

#temperatureObject (readonly)

Returns the value of attribute temperature.



5
6
7
# File 'lib/yahoo_weather/units.rb', line 5

def temperature
  @temperature
end