Class: Barometer::Data::Distance

Inherits:
ConvertableUnits show all
Defined in:
lib/barometer/data/distance.rb

Instance Method Summary collapse

Methods inherited from ConvertableUnits

#<=>, #imperial, #initialize, #metric, #metric?, #nil?, #to_s

Constructor Details

This class inherits a constructor from Barometer::Data::ConvertableUnits

Instance Method Details

#kmObject



4
# File 'lib/barometer/data/distance.rb', line 4

def km; metric; end

#mObject



5
# File 'lib/barometer/data/distance.rb', line 5

def m; imperial; end

#unitsObject



7
8
9
# File 'lib/barometer/data/distance.rb', line 7

def units
  metric? ? 'km' : 'm'
end