Class: KOAUtils::StringLogger
- Inherits:
-
Object
- Object
- KOAUtils::StringLogger
- Defined in:
- lib/koa-utils/logger.rb
Instance Method Summary collapse
- #flush ⇒ Object
-
#initialize ⇒ StringLogger
constructor
A new instance of StringLogger.
- #puts(msg) ⇒ Object
Constructor Details
#initialize ⇒ StringLogger
Returns a new instance of StringLogger.
4 5 6 |
# File 'lib/koa-utils/logger.rb', line 4 def initialize @msgs = [] end |
Instance Method Details
#flush ⇒ Object
12 13 14 |
# File 'lib/koa-utils/logger.rb', line 12 def flush @msgs.length.times.map {@msgs.pop} end |
#puts(msg) ⇒ Object
8 9 10 |
# File 'lib/koa-utils/logger.rb', line 8 def puts(msg) @msgs << msg end |