class Floss::Log

See Section 5.3.

See Section 5.3.

Public Class Methods

new(options={}) click to toggle source
# File lib/floss/log.rb, line 24
def initialize(options={})
  raise NotImplementedError
end

Public Instance Methods

[]=(k,v) click to toggle source
# File lib/floss/log.rb, line 28
def []=(k,v)
  raise NotImplementedError
end
append(new_entries) click to toggle source

@param [Array] The entries to append to the log.

# File lib/floss/log.rb, line 37
def append(new_entries)
  raise NotImplementedError
end
complete?(other_term, other_index) click to toggle source
# File lib/floss/log.rb, line 55
def complete?(other_term, other_index)
  # Special case: Accept the first entry if the log is empty.
  return empty? if other_term.nil? && other_index.nil?

  (other_term > last_term) || (other_term == last_term && other_index >= last_index)
end
empty?() click to toggle source
# File lib/floss/log.rb, line 32
def empty?
  raise NotImplementedError
end
last_index() click to toggle source

Returns the last index in the log or nil if the log is empty.

# File lib/floss/log.rb, line 46
def last_index
  raise NotImplementedError
end
last_term() click to toggle source

Returns the term of the last entry in the log or nil if the log is empty.

# File lib/floss/log.rb, line 51
def last_term
  raise NotImplementedError
end
remove_starting_with(index) click to toggle source
# File lib/floss/log.rb, line 66
def remove_starting_with(index)
  raise NotImplementedError
end
starting_with(index) click to toggle source
# File lib/floss/log.rb, line 41
def starting_with(index)
  raise NotImplementedError
end
validate(index, term) click to toggle source
# File lib/floss/log.rb, line 62
def validate(index, term)
  raise NotImplementedError
end