Class: Logbert::Handlers::ArrayHandler
- Inherits:
-
BaseHandler
- Object
- BaseHandler
- Logbert::Handlers::ArrayHandler
- Defined in:
- lib/logbert/handlers/array_handler.rb
Overview
Writes all of the log messages to an array.
Instance Attribute Summary collapse
-
#messages ⇒ Object
Returns the value of attribute messages.
Instance Method Summary collapse
- #emit(output) ⇒ Object
-
#initialize(messages = []) ⇒ ArrayHandler
constructor
A new instance of ArrayHandler.
Methods inherited from BaseHandler
#formatter, #formatter=, #publish
Constructor Details
#initialize(messages = []) ⇒ ArrayHandler
Returns a new instance of ArrayHandler.
11 12 13 |
# File 'lib/logbert/handlers/array_handler.rb', line 11 def initialize( = []) @messages = end |
Instance Attribute Details
#messages ⇒ Object
Returns the value of attribute messages.
9 10 11 |
# File 'lib/logbert/handlers/array_handler.rb', line 9 def @messages end |
Instance Method Details
#emit(output) ⇒ Object
15 16 17 |
# File 'lib/logbert/handlers/array_handler.rb', line 15 def emit(output) @messages << output end |