class SparkleFormation::AuditLog

Attributes

list[R]

Public Class Methods

new() click to toggle source
# File lib/sparkle_formation/audit_log.rb, line 70
def initialize
  @list = []
end

Public Instance Methods

<<(item) click to toggle source
# File lib/sparkle_formation/audit_log.rb, line 74
def <<(item)
  case item
  when Array
    item = Record.new(*item)
  when Hash
    item = Record.new(item)
  end
  add_item(item)
  item
end
Also aliased as: push
each(&block) click to toggle source
# File lib/sparkle_formation/audit_log.rb, line 87
def each(&block)
  list.each(&block)
end
push(item)
Alias for: <<

Private Instance Methods

add_item(item) click to toggle source
# File lib/sparkle_formation/audit_log.rb, line 93
def add_item(item)
  if !item.is_a?(Record)
    raise TypeError, "Expected #{Record.class.name} but " \
          "received #{item.class.name}"
  end
  list.push(item)
end