Module: Charming::Internal::Terminal::Adapter
- Included in:
- MemoryBackend, TTYBackend
- Defined in:
- lib/charming/internal/terminal/adapter.rb
Overview
Contract for terminal adapters used by Runtime and renderers. Concrete adapters provide input events, terminal dimensions, and output primitives for full or partial frame rendering.
Instance Method Summary collapse
- #clear ⇒ Object
- #enter_alt_screen ⇒ Object
- #hide_cursor ⇒ Object
- #leave_alt_screen ⇒ Object
- #move_cursor(row, column) ⇒ Object
- #read_event(timeout: nil) ⇒ Object
- #show_cursor ⇒ Object
- #size ⇒ Object
- #write_frame(frame) ⇒ Object
- #write_lines(line_changes, frame: nil) ⇒ Object
Instance Method Details
#clear ⇒ Object
34 35 36 |
# File 'lib/charming/internal/terminal/adapter.rb', line 34 def clear raise NotImplementedError, "#{self.class} must implement #clear" end |
#enter_alt_screen ⇒ Object
18 19 20 |
# File 'lib/charming/internal/terminal/adapter.rb', line 18 def enter_alt_screen raise NotImplementedError, "#{self.class} must implement #enter_alt_screen" end |
#hide_cursor ⇒ Object
26 27 28 |
# File 'lib/charming/internal/terminal/adapter.rb', line 26 def hide_cursor raise NotImplementedError, "#{self.class} must implement #hide_cursor" end |
#leave_alt_screen ⇒ Object
22 23 24 |
# File 'lib/charming/internal/terminal/adapter.rb', line 22 def leave_alt_screen raise NotImplementedError, "#{self.class} must implement #leave_alt_screen" end |
#move_cursor(row, column) ⇒ Object
38 39 40 |
# File 'lib/charming/internal/terminal/adapter.rb', line 38 def move_cursor(row, column) raise NotImplementedError, "#{self.class} must implement #move_cursor" end |
#read_event(timeout: nil) ⇒ Object
10 11 12 |
# File 'lib/charming/internal/terminal/adapter.rb', line 10 def read_event(timeout: nil) raise NotImplementedError, "#{self.class} must implement #read_event" end |
#show_cursor ⇒ Object
30 31 32 |
# File 'lib/charming/internal/terminal/adapter.rb', line 30 def show_cursor raise NotImplementedError, "#{self.class} must implement #show_cursor" end |
#size ⇒ Object
14 15 16 |
# File 'lib/charming/internal/terminal/adapter.rb', line 14 def size raise NotImplementedError, "#{self.class} must implement #size" end |
#write_frame(frame) ⇒ Object
42 43 44 |
# File 'lib/charming/internal/terminal/adapter.rb', line 42 def write_frame(frame) raise NotImplementedError, "#{self.class} must implement #write_frame" end |
#write_lines(line_changes, frame: nil) ⇒ Object
46 47 48 |
# File 'lib/charming/internal/terminal/adapter.rb', line 46 def write_lines(line_changes, frame: nil) raise NotImplementedError, "#{self.class} must implement #write_lines" end |