Class: Numeric

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

Direct Known Subclasses

Unit

Instance Method Summary collapse

Instance Method Details

#to_unit(other = nil) ⇒ Unit Also known as: unit, u

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 ? Unit.new(self, other) : Unit.new(self)
end