Module: AUOM::Relational

Includes:
Comparable
Included in:
Unit
Defined in:
lib/auom/relational.rb

Overview

Mixin to add relational operators

Instance Method Summary collapse

Instance Method Details

#<=>(other) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Perform comparison operation

Parameters:

Returns:

  • (Object)


16
17
18
19
20
# File 'lib/auom/relational.rb', line 16

def <=>(other)
  assert_same_unit(other)

  scalar <=> other.scalar
end