Class: RSpec::Conductor::Util::Terminal::Line
- Inherits:
-
Object
- Object
- RSpec::Conductor::Util::Terminal::Line
- Defined in:
- lib/rspec/conductor/util/terminal.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#truncate ⇒ Object
readonly
Returns the value of attribute truncate.
Instance Method Summary collapse
-
#initialize(terminal, content, truncate: true, redraw: true) {|_self| ... } ⇒ Line
constructor
A new instance of Line.
- #lines ⇒ Object
- #to_s ⇒ Object
- #update(new_content, redraw: true) ⇒ Object
Constructor Details
#initialize(terminal, content, truncate: true, redraw: true) {|_self| ... } ⇒ Line
Returns a new instance of Line.
14 15 16 17 18 19 |
# File 'lib/rspec/conductor/util/terminal.rb', line 14 def initialize(terminal, content, truncate: true, redraw: true) @terminal = terminal @truncate = truncate yield self if block_given? update(content, redraw: redraw) end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
12 13 14 |
# File 'lib/rspec/conductor/util/terminal.rb', line 12 def content @content end |
#truncate ⇒ Object (readonly)
Returns the value of attribute truncate.
12 13 14 |
# File 'lib/rspec/conductor/util/terminal.rb', line 12 def truncate @truncate end |
Instance Method Details
#lines ⇒ Object
30 31 32 |
# File 'lib/rspec/conductor/util/terminal.rb', line 30 def lines @content ? [self] : [] end |
#to_s ⇒ Object
26 27 28 |
# File 'lib/rspec/conductor/util/terminal.rb', line 26 def to_s @content end |
#update(new_content, redraw: true) ⇒ Object
21 22 23 24 |
# File 'lib/rspec/conductor/util/terminal.rb', line 21 def update(new_content, redraw: true) @content = new_content @terminal.redraw if redraw end |