class Raft::LogEntry
Attributes
command[R]
index[R]
term[R]
Public Class Methods
new(term, index, command)
click to toggle source
# File lib/raft.rb, line 21 def initialize(term, index, command) @term, @index, @command = term, index, command end
Public Instance Methods
==(other)
click to toggle source
# File lib/raft.rb, line 25 def ==(other) [:term, :index, :command].all? do |attr| self.send(attr) == other.send(attr) end end
eql?(other)
click to toggle source
# File lib/raft.rb, line 31 def eql?(other) self == other end
hash()
click to toggle source
# File lib/raft.rb, line 35 def hash [:term, :index, :command].reduce(0) do |h, attr| h ^= self.send(attr) end end