Class: SparkleFormation::AuditLog

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/sparkle_formation/audit_log.rb

Defined Under Namespace

Classes: Record, SourcePoint

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAuditLog

Returns a new instance of AuditLog.



70
71
72
# File 'lib/sparkle_formation/audit_log.rb', line 70

def initialize
  @list = []
end

Instance Attribute Details

#listObject (readonly)

Returns the value of attribute list.



68
69
70
# File 'lib/sparkle_formation/audit_log.rb', line 68

def list
  @list
end

Instance Method Details

#<<(item) ⇒ Object Also known as: push



74
75
76
77
78
79
80
81
82
83
# 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

#each(&block) ⇒ Object



87
88
89
# File 'lib/sparkle_formation/audit_log.rb', line 87

def each(&block)
  list.each(&block)
end