Class: Charming::Component

Inherits:
View
  • Object
show all
Defined in:
lib/charming/presentation/component.rb

Overview

Component is the base class for all reusable terminal widgets. It inherits from View to gain assigns, helper methods (text, box, row, column, etc.), and rendering via render.

Instance Method Summary collapse

Methods inherited from View

#focused?, #initialize, #layout_assigns, #render

Constructor Details

This class inherits a constructor from Charming::View

Instance Method Details

#captures_text?Boolean

True for components that accept free-typed text (TextInput, TextArea, Form, …). While such a component is focused, the controller routes printable characters to it BEFORE global/content key bindings — so typing “q” or “?” into a field inserts the character instead of triggering an app shortcut.

Returns:

  • (Boolean)


11
12
13
# File 'lib/charming/presentation/component.rb', line 11

def captures_text?
  false
end