Class: Boty::Logger::Memory

Inherits:
Logger
  • Object
show all
Defined in:
lib/boty/logger.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMemory

Returns a new instance of Memory.



51
52
53
# File 'lib/boty/logger.rb', line 51

def initialize(*)
  @logs = []
end

Instance Attribute Details

#logsObject (readonly)

Returns the value of attribute logs.



49
50
51
# File 'lib/boty/logger.rb', line 49

def logs
  @logs
end

Instance Method Details

#add(*args, &block) ⇒ Object



55
56
57
58
59
60
61
# File 'lib/boty/logger.rb', line 55

def add(*args, &block)
  @logs << if block_given?
             block.call
           else
             args[2]
           end
end