Module: MongoOplogBackup::Ext::Timestamp

Defined in:
lib/mongo_oplog_backup/ext/timestamp.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#<=>(other) ⇒ Object



7
8
9
# File 'lib/mongo_oplog_backup/ext/timestamp.rb', line 7

def <=> other
  [seconds, increment] <=> [other.seconds, other.increment]
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/mongo_oplog_backup/ext/timestamp.rb', line 19

def eql? other
  self == other
end

#hashObject



15
16
17
# File 'lib/mongo_oplog_backup/ext/timestamp.rb', line 15

def hash
  to_s.hash
end

#to_sObject



11
12
13
# File 'lib/mongo_oplog_backup/ext/timestamp.rb', line 11

def to_s
  "#{seconds}:#{increment}"
end