Class: Numeric

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

Direct Known Subclasses

RubyUnits::Unit

Instance Method Summary collapse

Instance Method Details

#to_unit(other = nil) ⇒ Unit

make a unitless unit with a given scalar

Returns:



4
5
6
# File 'lib/ruby_units/numeric.rb', line 4

def to_unit(other = nil)
  other ? RubyUnits::Unit.new(self, other) : RubyUnits::Unit.new(self)
end