class Oplogjam::Noop

Attributes

h[R]
id[R]
message[R]
msg[R]
ts[R]

Public Class Methods

from(bson) click to toggle source
# File lib/oplogjam/noop.rb, line 7
def self.from(bson)
  h = bson.fetch(H)
  ts = bson.fetch(TS)
  o = bson.fetch(O)
  msg = o.fetch(MSG)

  new(h, ts, msg)
rescue KeyError => e
  raise InvalidNoop, "missing field: #{e}"
end
new(h, ts, msg) click to toggle source
# File lib/oplogjam/noop.rb, line 18
def initialize(h, ts, msg)
  @h = Integer(h)
  @ts = Oplogjam::Timestamp(ts)
  @msg = String(msg)
end

Public Instance Methods

==(other) click to toggle source
# File lib/oplogjam/noop.rb, line 31
def ==(other)
  return false unless other.is_a?(Noop)

  id == other.id
end
apply(_mapping) click to toggle source
# File lib/oplogjam/noop.rb, line 37
def apply(_mapping); end
timestamp() click to toggle source
# File lib/oplogjam/noop.rb, line 27
def timestamp
  Time.at(ts.seconds, ts.increment)
end