Class: RSpec::Conductor::Util::Terminal::Box
- Inherits:
-
Object
- Object
- RSpec::Conductor::Util::Terminal::Box
- Defined in:
- lib/rspec/conductor/util/terminal.rb
Instance Method Summary collapse
- #box ⇒ Object
-
#initialize(terminal) {|_self| ... } ⇒ Box
constructor
A new instance of Box.
- #line(content = "", truncate: true, redraw: true) ⇒ Object
- #lines ⇒ Object
- #puts(content = "", redraw: true) ⇒ Object
Constructor Details
#initialize(terminal) {|_self| ... } ⇒ Box
Returns a new instance of Box.
36 37 38 39 40 |
# File 'lib/rspec/conductor/util/terminal.rb', line 36 def initialize(terminal) @terminal = terminal @contents = [] yield self if block_given? end |
Instance Method Details
#box ⇒ Object
50 51 52 |
# File 'lib/rspec/conductor/util/terminal.rb', line 50 def box Box.new(@terminal) { |b| @contents << b } end |
#line(content = "", truncate: true, redraw: true) ⇒ Object
42 43 44 |
# File 'lib/rspec/conductor/util/terminal.rb', line 42 def line(content = "", truncate: true, redraw: true) Line.new(@terminal, content, truncate: truncate, redraw: redraw) { |l| @contents << l } end |
#lines ⇒ Object
54 55 56 |
# File 'lib/rspec/conductor/util/terminal.rb', line 54 def lines @contents.flat_map(&:lines) end |
#puts(content = "", redraw: true) ⇒ Object
46 47 48 |
# File 'lib/rspec/conductor/util/terminal.rb', line 46 def puts(content = "", redraw: true) line(content, truncate: false, redraw: redraw) end |