Class: Numeric

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

Overview

make a unitless unit with a given scalar

Direct Known Subclasses

Complex, Unit

Instance Method Summary collapse

Instance Method Details

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



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

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