Class: Console::Output::Terminal::Buffer
- Inherits:
-
StringIO
- Object
- StringIO
- Console::Output::Terminal::Buffer
- Defined in:
- lib/console/output/terminal.rb
Instance Attribute Summary collapse
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
Instance Method Summary collapse
-
#initialize(prefix = nil) ⇒ Buffer
constructor
A new instance of Buffer.
- #puts(*args, prefix: @prefix) ⇒ Object (also: #<<)
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
#prefix ⇒ Object (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 |