Class: Fixnum

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

Overview

:nocov_19:

Instance Method Summary collapse

Instance Method Details

#quo_with_units(other) ⇒ Unit, Integer Also known as: quo, /

Note:

this patch is necessary for ruby 1.8 because cases where Integers are divided by Units don’t work quite right

Parameters:

Returns:



9
10
11
12
13
14
15
16
# File 'lib/ruby_units/fixnum.rb', line 9

def quo_with_units(other)
  case other
  when RubyUnits::Unit
    self * other.inverse
  else
    quo_without_units(other)
  end
end