Class: Binocs::TUI::App

Inherits:
Object
  • Object
show all
Defined in:
lib/binocs/tui/app.rb

Constant Summary collapse

DEFAULT_REFRESH_INTERVAL =

seconds

2

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ App

Returns a new instance of App.



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/binocs/tui/app.rb', line 10

def initialize(options = {})
  @running = false
  @mode = :list # :list, :detail, :help, :filter, :search, :agents, :agent_output, :spirit_animal, :sequence, :endpoints
  @last_refresh = Time.now
  @search_buffer = ''
  @refresh_interval = options[:refresh_interval] || DEFAULT_REFRESH_INTERVAL
  @agents_window = nil
  @agent_output_window = nil
  @spirit_animal_window = nil
  @sequence_window = nil
  @endpoints_window = nil
  @last_key = nil # Track last key for combo detection
end

Instance Attribute Details

#runningObject (readonly)

Returns the value of attribute running.



8
9
10
# File 'lib/binocs/tui/app.rb', line 8

def running
  @running
end

Instance Method Details

#runObject



24
25
26
27
28
29
30
31
32
33
# File 'lib/binocs/tui/app.rb', line 24

def run
  setup_curses
  create_windows
  load_data

  @running = true
  main_loop
ensure
  cleanup
end