Class: Numeric

Inherits:
Object
  • Object
show all
Defined in:
lib/unit/dsl.rb

Direct Known Subclasses

Unit

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, system = nil) ⇒ Object



6
7
8
9
10
# File 'lib/unit/dsl.rb', line 6

def method_missing(name, system = nil)
  Unit.to_unit(Unit.method_name_to_unit(name), system) * self
rescue TypeError
  super
end

Instance Method Details

#unit(unit, system = nil) ⇒ Object



2
3
4
# File 'lib/unit/dsl.rb', line 2

def unit(unit, system = nil)
  Unit.to_unit(unit, system) * self
end