Class: MemoryLogger::Logger
- Inherits:
-
Object
- Object
- MemoryLogger::Logger
- Defined in:
- lib/memory_logger.rb
Instance Attribute Summary collapse
-
#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
- #method_missing(sym, *args, &block) ⇒ Object
Constructor Details
#initialize ⇒ Logger
Returns a new instance of Logger.
12 13 14 15 |
# File 'lib/memory_logger.rb', line 12 def initialize @io = StringIO.new @logger = Logger.new(@io) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym, *args, &block) ⇒ Object
8 9 10 |
# File 'lib/memory_logger.rb', line 8 def method_missing(sym, *args, &block) logger.send(sym, *args, &block) end |
Instance Attribute Details
#logger ⇒ Object
Returns the value of attribute logger.
6 7 8 |
# File 'lib/memory_logger.rb', line 6 def logger @logger end |
Instance Method Details
#logged_output ⇒ Object
17 18 19 |
# File 'lib/memory_logger.rb', line 17 def logged_output @io.string end |
#messages ⇒ Object
21 22 23 |
# File 'lib/memory_logger.rb', line 21 def logged_output.split("\n") end |