Class: MemoryLogger::Logger
- Inherits:
-
Object
- Object
- MemoryLogger::Logger
show all
- Defined in:
- lib/memory_logger.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize ⇒ 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 messages
logged_output.split("\n")
end
|