Method: Quantify::Unit::Base#multiply
- Defined in:
- lib/quantify/unit/base_unit.rb
#multiply(other) ⇒ Object Also known as: times, *
Multiply two units together. This results in the generation of a compound unit.
444 445 446 447 448 449 |
# File 'lib/quantify/unit/base_unit.rb', line 444 def multiply(other) = [] self.instance_of?(Unit::Compound) ? += @base_units : << self other.instance_of?(Unit::Compound) ? += other.base_units : << other Unit::Compound.new(*) end |