Class: Yweather::Units

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

Constant Summary collapse

FAHRENHEIT =
'f'
CELSIUS =
'c'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Units

Returns a new instance of Units.



12
13
14
15
16
17
# File 'lib/yweather/units.rb', line 12

def initialize(data)
  @temperature = data[:temperature]
  @distance = data[:distance]
  @pressure = data[:pressure]
  @speed = data[:speed]
end

Instance Attribute Details

#distanceObject (readonly)

Returns the value of attribute distance.



8
9
10
# File 'lib/yweather/units.rb', line 8

def distance
  @distance
end

#pressureObject (readonly)

Returns the value of attribute pressure.



9
10
11
# File 'lib/yweather/units.rb', line 9

def pressure
  @pressure
end

#speedObject (readonly)

Returns the value of attribute speed.



10
11
12
# File 'lib/yweather/units.rb', line 10

def speed
  @speed
end

#temperatureObject (readonly)

Returns the value of attribute temperature.



7
8
9
# File 'lib/yweather/units.rb', line 7

def temperature
  @temperature
end