Class: Console::Output::Terminal::Buffer

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(prefix = nil) ⇒ Buffer

Returns a new instance of Buffer.



19
20
21
22
23
# File 'lib/console/output/terminal.rb', line 19

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

Instance Attribute Details

#prefixObject (readonly)

Returns the value of attribute prefix.



25
26
27
# File 'lib/console/output/terminal.rb', line 25

def prefix
  @prefix
end

Instance Method Details

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



27
28
29
30
31
32
# File 'lib/console/output/terminal.rb', line 27

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