Class: MemoryLogger::Logger
- Inherits:
-
Object
- Object
- MemoryLogger::Logger
- Defined in:
- lib/memory_logger.rb
Instance Attribute Summary collapse
-
#formatter ⇒ Object
Returns the value of attribute formatter.
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
-
#initialize ⇒ Logger
constructor
A new instance of Logger.
- #logged_output ⇒ Object
- #messages ⇒ Object
Constructor Details
#initialize ⇒ Logger
Returns a new instance of Logger.
16 17 18 19 |
# File 'lib/memory_logger.rb', line 16 def initialize @io = StringIO.new @logger = ::Logger.new(@io) end |
Instance Attribute Details
#formatter ⇒ Object
Returns the value of attribute formatter.
8 9 10 |
# File 'lib/memory_logger.rb', line 8 def formatter @formatter end |
#logger ⇒ Object
Returns the value of attribute logger.
8 9 10 |
# File 'lib/memory_logger.rb', line 8 def logger @logger end |
Instance Method Details
#logged_output ⇒ Object
21 22 23 |
# File 'lib/memory_logger.rb', line 21 def logged_output @io.string end |
#messages ⇒ Object
25 26 27 |
# File 'lib/memory_logger.rb', line 25 def logged_output.split("\n") end |