Method: RbNaCl::KeyComparator#<=>
- Defined in:
- lib/rbnacl/key_comparator.rb
#<=>(other) ⇒ 0, ...
spaceship operator
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/rbnacl/key_comparator.rb', line 17 def <=>(other) if KeyComparator > other.class other = other.to_bytes elsif other.respond_to?(:to_str) other = other.to_str else return nil end if Util.verify32(self.to_bytes, other) return 0 elsif self.to_bytes > other return 1 else return -1 end end |