Method: Tap::Support::Audit#initialize

Defined in:
lib/tap/support/audit.rb

#initialize(key = nil, value = nil, sources = nil) ⇒ Audit

Initializes a new Audit. Sources may be an array, a single value (which is turned into an array), or nil (indicating no sources).

_a = Audit.new(nil, nil, nil)
_a.sources                        # => []

_b = Audit.new(nil, nil, _a)
_b.sources                        # => [_a]

_c = Audit.new(nil, nil, [_a,_b])
_c.sources                        # => [_a,_b]


227
228
229
230
231
# File 'lib/tap/support/audit.rb', line 227

def initialize(key=nil, value=nil, sources=nil)
  @key = key
  @value = value
  @source = singularize(sources)
end