Class: Stick::Units::Converter::Conversion

Inherits:
Struct
  • Object
show all
Defined in:
lib/stick/units/base.rb,
lib/stick/units/base.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#multiplierObject

Returns the value of attribute multiplier

Returns:

  • (Object)

    the current value of multiplier



641
642
643
# File 'lib/stick/units/base.rb', line 641

def multiplier
  @multiplier
end

#unitsObject

Returns the value of attribute units

Returns:

  • (Object)

    the current value of units



641
642
643
# File 'lib/stick/units/base.rb', line 641

def units
  @units
end

Instance Method Details

#*(m) ⇒ Object



649
650
651
# File 'lib/stick/units/base.rb', line 649

def *(m)
  Conversion.new(units * m.units, multiplier * m.multiplier)
end

#**(p) ⇒ Object



645
646
647
# File 'lib/stick/units/base.rb', line 645

def **(p)
  Conversion.new(units ** p, multiplier ** p)
end

#/(m) ⇒ Object



653
654
655
# File 'lib/stick/units/base.rb', line 653

def /(m)
  Conversion.new(units / m.units, multiplier / m.multiplier)
end