Class: YahooWeather::Units

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

Overview

Describes the units of measure with which weather information is provided.

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.



18
19
20
21
22
23
# File 'lib/yahoo-weather/units.rb', line 18

def initialize (payload)
  @temperature = payload['temperature']
  @distance = payload['distance']
  @pressure = payload['pressure']
  @speed = payload['speed']
end

Instance Attribute Details

#distanceObject (readonly)

the units in which distance is measured, e.g. mi for miles.



10
11
12
# File 'lib/yahoo-weather/units.rb', line 10

def distance
  @distance
end

#pressureObject (readonly)

the units in which pressure is measured, e.g. in for inches.



13
14
15
# File 'lib/yahoo-weather/units.rb', line 13

def pressure
  @pressure
end

#speedObject (readonly)

the units in which speed is measured, e.g. mph for miles per hour.



16
17
18
# File 'lib/yahoo-weather/units.rb', line 16

def speed
  @speed
end

#temperatureObject (readonly)

the units in which temperature is measured, e.g. F for Fahrenheit or C for Celsius.



7
8
9
# File 'lib/yahoo-weather/units.rb', line 7

def temperature
  @temperature
end