Class: RSpecTelemetry::Trace::Viewer::StatusLine

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec_telemetry/trace/viewer/status_line.rb

Constant Summary collapse

HINTS =
"1-3=views  Tab=pane  f=follow  q=quit"

Instance Method Summary collapse

Constructor Details

#initialize(document, position:, follow: false, spinner: nil, pending: false, notice: nil, total_ms: nil, mode: nil) ⇒ StatusLine

Returns a new instance of StatusLine.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/rspec_telemetry/trace/viewer/status_line.rb', line 12

def initialize(
  document,
  position:,
  follow: false,
  spinner: nil,
  pending: false,
  notice: nil,
  total_ms: nil,
  mode: nil
)
  @document = document
  @position = position
  @follow = follow
  @spinner = spinner
  @pending = pending
  @notice = notice
  @total_ms = total_ms
  @mode = mode
end

Instance Method Details

#draw(canvas, rect) ⇒ Object



32
33
34
35
# File 'lib/rspec_telemetry/trace/viewer/status_line.rb', line 32

def draw(canvas, rect)
  right = "#{@position}  #{@notice || HINTS} "
  TuiTui::StatusBar.draw(canvas, rect, left: left_text, right: right, style: Theme::BAR)
end