Class: Async::Logger::Buffer
- Inherits:
-
StringIO
- Object
- StringIO
- Async::Logger::Buffer
- Defined in:
- lib/async/logger.rb
Instance Method Summary collapse
-
#initialize(prefix = nil) ⇒ Buffer
constructor
A new instance of Buffer.
- #puts(*args, prefix: @prefix) ⇒ Object
Constructor Details
#initialize(prefix = nil) ⇒ Buffer
Returns a new instance of Buffer.
29 30 31 32 33 |
# File 'lib/async/logger.rb', line 29 def initialize(prefix = nil) @prefix = prefix super() end |
Instance Method Details
#puts(*args, prefix: @prefix) ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/async/logger.rb', line 35 def puts(*args, prefix: @prefix) args.each do |arg| self.write(prefix) if prefix super(arg) end end |