Module: RichEngine::Terminal Private

Defined in:
lib/rich_engine/terminal.rb,
lib/rich_engine/terminal/cursor.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Internal plumbing used by Game to prepare and restore the terminal: clearing the screen, toggling cursor visibility, and toggling input echo.

Defined Under Namespace

Modules: Cursor

Class Method Summary collapse

Class Method Details

.clearvoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Clears the screen.



16
17
18
# File 'lib/rich_engine/terminal.rb', line 16

def clear
  $stdout.clear_screen
end

.disable_echovoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Stops typed characters from being echoed to the screen.



37
38
39
# File 'lib/rich_engine/terminal.rb', line 37

def disable_echo
  $stdin.echo = false
end

.display_cursorvoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Shows the terminal cursor.



30
31
32
# File 'lib/rich_engine/terminal.rb', line 30

def display_cursor
  Cursor.display
end

.enable_echovoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Resumes echoing typed characters to the screen.



44
45
46
# File 'lib/rich_engine/terminal.rb', line 44

def enable_echo
  $stdin.echo = true
end

.hide_cursorvoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Hides the terminal cursor.



23
24
25
# File 'lib/rich_engine/terminal.rb', line 23

def hide_cursor
  Cursor.hide
end