Class: Koa::StringLogger

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

Instance Method Summary collapse

Constructor Details

#initializeStringLogger

Returns a new instance of StringLogger.



4
5
6
# File 'lib/koa/logger.rb', line 4

def initialize
  @msgs = []
end

Instance Method Details

#flushObject



12
13
14
# File 'lib/koa/logger.rb', line 12

def flush
  @msgs.length.times.map {@msgs.pop}
end

#puts(msg) ⇒ Object



8
9
10
# File 'lib/koa/logger.rb', line 8

def puts(msg)
  @msgs << msg
end