Module: Conversions::Ext

Defined in:
lib/conversions.rb

Instance Method Summary collapse

Instance Method Details

#convert(from, to, options = {}) ⇒ Object

Convert from one unit to another.

  • from: The unit to convert from (ie. :miles, :stones, or :pints)

  • to: The unit to convert to

  • options:

    • :scale: The number of digits you want after the dot.



51
52
53
# File 'lib/conversions.rb', line 51

def convert(from, to, options={})
  Conversions::Unit.new(self, from).to(to, options)
end