Class: RSpecTelemetry::Trace::Viewer::DetailPane
- Inherits:
-
Object
- Object
- RSpecTelemetry::Trace::Viewer::DetailPane
- Defined in:
- lib/rspec_telemetry/trace/viewer/detail_pane.rb
Instance Method Summary collapse
- #draw(canvas, rect) ⇒ Object
-
#initialize(lines, scroll:) ⇒ DetailPane
constructor
A new instance of DetailPane.
- #length ⇒ Object
Constructor Details
#initialize(lines, scroll:) ⇒ DetailPane
Returns a new instance of DetailPane.
9 10 11 12 |
# File 'lib/rspec_telemetry/trace/viewer/detail_pane.rb', line 9 def initialize(lines, scroll:) @lines = lines @scroll = scroll end |
Instance Method Details
#draw(canvas, rect) ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/rspec_telemetry/trace/viewer/detail_pane.rb', line 16 def draw(canvas, rect) TuiTui::TextView.draw(canvas, rect, top: @scroll, scrollbar: Theme.base, total: @lines.length) do |index| line = @lines[index] next nil if line.nil? style = index.zero? ? Theme.style(:action) : Theme.style(:dim) TuiTui::Line[TuiTui::Span[line, style]] end end |
#length ⇒ Object
14 |
# File 'lib/rspec_telemetry/trace/viewer/detail_pane.rb', line 14 def length = @lines.length |