Method: Unit#in!

Defined in:
lib/unit/class.rb

#in!(unit) ⇒ Object



149
150
151
152
153
154
155
156
# File 'lib/unit/class.rb', line 149

def in!(unit)
  unit = coerce_object(unit)
  result = self.in(unit)
  unless result.unit == unit.unit
    raise TypeError, "Unexpected #{result.inspect}, expected to be in #{other_unit.unit_string}"
  end
  result
end