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



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

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

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


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

def eql? other
  self == other
end

#hashObject



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

def hash
  to_s.hash
end

#to_sObject



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

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