Class: YahooWeather::Units

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

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(payload) ⇒ Units

Returns a new instance of Units.



72
73
74
75
76
77
# File 'lib/yahoo-weather.rb', line 72

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.



64
65
66
# File 'lib/yahoo-weather.rb', line 64

def distance
  @distance
end

#pressureObject (readonly)

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



67
68
69
# File 'lib/yahoo-weather.rb', line 67

def pressure
  @pressure
end

#speedObject (readonly)

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



70
71
72
# File 'lib/yahoo-weather.rb', line 70

def speed
  @speed
end

#temperatureObject (readonly)

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



61
62
63
# File 'lib/yahoo-weather.rb', line 61

def temperature
  @temperature
end