Class: TUI::App
- Inherits:
-
Object
- Object
- TUI::App
- Defined in:
- lib/tui/app.rb
Constant Summary collapse
- SCREENS =
%i[chat settings anthropic].freeze
- COMMAND_KEYS =
{ "n" => :new_session, "s" => :settings, "a" => :anthropic, "q" => :quit }.freeze
- MENU_LABELS =
COMMAND_KEYS.map { |key, action| "[#{key}] #{action.capitalize}" }.freeze
- SIDEBAR_WIDTH =
28
Instance Attribute Summary collapse
-
#command_mode ⇒ Object
readonly
Returns the value of attribute command_mode.
-
#current_screen ⇒ Object
readonly
Returns the value of attribute current_screen.
Instance Method Summary collapse
-
#initialize ⇒ App
constructor
A new instance of App.
- #run ⇒ Object
Constructor Details
Instance Attribute Details
#command_mode ⇒ Object (readonly)
Returns the value of attribute command_mode.
22 23 24 |
# File 'lib/tui/app.rb', line 22 def command_mode @command_mode end |
#current_screen ⇒ Object (readonly)
Returns the value of attribute current_screen.
22 23 24 |
# File 'lib/tui/app.rb', line 22 def current_screen @current_screen end |
Instance Method Details
#run ⇒ Object
34 35 36 37 38 39 40 41 42 |
# File 'lib/tui/app.rb', line 34 def run RatatuiRuby.run do |tui| loop do tui.draw { |frame| render(frame, tui) } break if handle_event(tui.poll_event) == :quit end end end |