Class: Numeric

Inherits:
Object
  • Object
show all
Defined in:
lib/unitwise/ext/numeric.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args, &block) ⇒ Object



6
7
8
9
10
# File 'lib/unitwise/ext/numeric.rb', line 6

def method_missing(meth, *args, &block)
  convert(meth)
rescue Unitwise::ExpressionError
  super(meth, *args)
end

Instance Method Details

#convert(unit) ⇒ Object



2
3
4
# File 'lib/unitwise/ext/numeric.rb', line 2

def convert(unit)
  Unitwise::Measurement.new(self, unit)
end