module RbNaCl::KeyComparator

def <=>(other)

Returns:
  • (nil) - if comparison doesn't make sense
  • (-1) - if the key is smaller than the other key
  • (1) - if the key is larger than the other key
  • (0) - if the keys are equal

Parameters:
  • other (KeyComparator, #to_str) -- The thing to compare
def <=>(other)
  if KeyComparator > other.class
    other = other.to_bytes
  elsif other.respond_to?(:to_str)
    other = other.to_str
  else
    return nil
  end
  compare32(other)
end