class BSON::Timestamp

def <=>(other)

Other tags:
    Since: - 4.3.0

Returns:
  • (true, false) - The result of the comparison.

Parameters:
  • other (Object) -- The object to compare against.

Other tags:
    Example: Compare the timestamp. -
def <=>(other)
  raise ArgumentError.new(COMPARISON_ERROR_MESSAGE % other.class) unless other.is_a?(Timestamp)
  return 0 if self == other
  a = [ seconds, increment ]
  b = [ other.seconds, other.increment ]
  [ a, b ].sort[0] == a ? -1 : 1
end