Class: Console::Buffer

Inherits:
StringIO
  • Object
show all
Defined in:
lib/console/buffer.rb

Instance Method Summary collapse

Constructor Details

#initialize(prefix = nil) ⇒ Buffer

Returns a new instance of Buffer.



10
11
12
13
14
# File 'lib/console/buffer.rb', line 10

def initialize(prefix = nil)
	@prefix = prefix
	
	super()
end

Instance Method Details

#puts(*args, prefix: @prefix) ⇒ Object Also known as: <<



16
17
18
19
20
21
# File 'lib/console/buffer.rb', line 16

def puts(*args, prefix: @prefix)
	args.each do |arg|
		self.write(prefix) if prefix
		super(arg)
	end
end