Module: Vedeu::Terminal
- Extended by:
- Forwardable, Terminal
- Includes:
- Mode
- Included in:
- Terminal
- Defined in:
- lib/vedeu/terminal/all.rb,
lib/vedeu/terminal/mode.rb,
lib/vedeu/terminal/terminal.rb
Overview
This module is the direct interface between Vedeu and your terminal/ console, via Ruby’s IO core library.
Defined Under Namespace
Modules: Mode
Class Method Summary collapse
-
.absent?(variable) ⇒ Boolean
extended
from Common
private
Returns a boolean indicating whether a variable is nil or empty.
-
.become(klass, attributes) ⇒ Class
extended
from Common
private
Converts one class into another.
-
.boolean(value) ⇒ Boolean
extended
from Common
private
Returns a boolean indicating the value was a boolean.
-
.boolean?(value) ⇒ Boolean
extended
from Common
private
Returns a boolean indicating whether the value is a Boolean.
-
.centre ⇒ Array
Returns a coordinate tuple of the format [y, x], where ‘y` is the row/line and `x` is the column/character.
-
.centre_x ⇒ Fixnum
Returns the ‘x` (column/character) component of the coodinate tuple provided by centre.
-
.centre_y ⇒ Fixnum
Returns the ‘y` (row/line) component of the coordinate tuple provided by centre.
-
.clear ⇒ String
Clears the entire terminal space.
-
.console ⇒ File
Provides our gateway into the wonderful rainbow-filled world of IO.
-
.cooked_mode! ⇒ Symbol
extended
from Mode
Sets the terminal in to ‘cooked` mode.
-
.cooked_mode? ⇒ Boolean
extended
from Mode
Returns a boolean indicating whether the terminal is currently in ‘cooked` mode.
-
.debugging! ⇒ String
Disables the mouse and shows the cursor.
-
.escape?(value) ⇒ Boolean
extended
from Common
private
Returns a boolean indicating whether the value is an escape sequence object (e.g. Cells::Escape.).
-
.fake_mode! ⇒ Symbol
extended
from Mode
Sets the terminal in to ‘fake` mode.
-
.fake_mode? ⇒ Boolean
extended
from Mode
Returns a boolean indicating whether the terminal is currently in ‘fake` mode.
-
.falsy?(value) ⇒ Boolean
extended
from Common
private
Returns a boolean indicating whether the value should be considered false.
-
.hash?(value) ⇒ Boolean
extended
from Common
private
Returns a boolean indicating whether the value is a Hash.
- .initialize_screen(mode, &block) ⇒ void
-
.line_model? ⇒ Boolean
extended
from Common
private
Returns a boolean indicating the model is a Views::Line.
-
.mode ⇒ Symbol
extended
from Mode
Returns the mode of the terminal, either ‘:cooked`, `:fake` or `:raw`.
-
.numeric?(value) ⇒ Boolean
extended
from Common
private
Returns a boolean indicating whether the value is a Fixnum.
-
.open(&block) ⇒ Array
Opens a terminal screen in either ‘raw` or `cooked` mode.
-
.origin ⇒ Fixnum
(also: #tx, #ty)
Returns 1.
-
.output(*streams) ⇒ Array
(also: #write)
Prints the streams to the screen and returns the streams.
-
.present?(variable) ⇒ Boolean
extended
from Common
private
Returns a boolean indicating whether a variable has a useful value.
-
.raw_mode! ⇒ Symbol
extended
from Mode
Sets the terminal in to ‘raw` mode.
-
.raw_mode? ⇒ Boolean
extended
from Mode
Returns a boolean indicating whether the terminal is currently in ‘raw` mode.
-
.resize ⇒ Boolean
-
.restore_screen ⇒ String
Attempts to tidy up the screen just before the application terminates.
-
.set_cursor_mode ⇒ String
Sets the cursor to be visible unless in raw mode, whereby it will be left hidden.
-
.size ⇒ Array<Fixnum>
Returns a tuple containing the height and width of the current terminal.
-
.snake_case(klass) ⇒ String
extended
from Common
private
Converts a class name to a lowercase snake case string.
-
.stream_model? ⇒ Boolean
extended
from Common
private
Returns a boolean indicating the model is a Views::Stream.
-
.string?(value) ⇒ Boolean
extended
from Common
private
Returns a boolean indicating whether the value is a Fixnum.
-
.switch_mode!(mode = nil) ⇒ Symbol
extended
from Mode
Changes the mode of the terminal to the mode given or toggles the terminal mode between ‘cooked`, `fake` and `raw`, depending on the current mode.
-
.truthy?(value) ⇒ Boolean
extended
from Common
private
Returns a boolean indicating whether the value should be considered true.
-
.valid_mode?(mode) ⇒ Boolean
extended
from Mode
private
Returns a boolean indicating whether the given mode is valid.
- .valid_modes ⇒ Array<Symbol> extended from Mode private
-
.view_model? ⇒ Boolean
extended
from Common
private
Returns a boolean indicating the model is a Views::View.
Instance Method Summary collapse
-
#absent?(variable) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether a variable is nil or empty.
-
#become(klass, attributes) ⇒ Class
included
from Common
private
Converts one class into another.
-
#boolean(value) ⇒ Boolean
included
from Common
private
Returns a boolean indicating the value was a boolean.
-
#boolean?(value) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether the value is a Boolean.
-
#centre ⇒ Array
Returns a coordinate tuple of the format [y, x], where ‘y` is the row/line and `x` is the column/character.
-
#centre_x ⇒ Fixnum
Returns the ‘x` (column/character) component of the coodinate tuple provided by centre.
-
#centre_y ⇒ Fixnum
Returns the ‘y` (row/line) component of the coordinate tuple provided by centre.
-
#clear ⇒ String
Clears the entire terminal space.
-
#console ⇒ File
Provides our gateway into the wonderful rainbow-filled world of IO.
-
#cooked_mode! ⇒ Symbol
included
from Mode
Sets the terminal in to ‘cooked` mode.
-
#cooked_mode? ⇒ Boolean
included
from Mode
Returns a boolean indicating whether the terminal is currently in ‘cooked` mode.
-
#debugging! ⇒ String
Disables the mouse and shows the cursor.
-
#escape?(value) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether the value is an escape sequence object (e.g. Cells::Escape.).
-
#fake_mode! ⇒ Symbol
included
from Mode
Sets the terminal in to ‘fake` mode.
-
#fake_mode? ⇒ Boolean
included
from Mode
Returns a boolean indicating whether the terminal is currently in ‘fake` mode.
-
#falsy?(value) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether the value should be considered false.
-
#hash?(value) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether the value is a Hash.
- #initialize_screen(mode, &block) ⇒ void
-
#line_model? ⇒ Boolean
included
from Common
private
Returns a boolean indicating the model is a Views::Line.
-
#mode ⇒ Symbol
included
from Mode
Returns the mode of the terminal, either ‘:cooked`, `:fake` or `:raw`.
-
#numeric?(value) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether the value is a Fixnum.
-
#open(&block) ⇒ Array
Opens a terminal screen in either ‘raw` or `cooked` mode.
-
#origin ⇒ Fixnum
(also: #tx, #ty)
Returns 1.
-
#output(*streams) ⇒ Array
(also: #write)
Prints the streams to the screen and returns the streams.
-
#present?(variable) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether a variable has a useful value.
-
#raw_mode! ⇒ Symbol
included
from Mode
Sets the terminal in to ‘raw` mode.
-
#raw_mode? ⇒ Boolean
included
from Mode
Returns a boolean indicating whether the terminal is currently in ‘raw` mode.
-
#resize ⇒ Boolean
-
#restore_screen ⇒ String
Attempts to tidy up the screen just before the application terminates.
-
#set_cursor_mode ⇒ String
Sets the cursor to be visible unless in raw mode, whereby it will be left hidden.
-
#size ⇒ Array<Fixnum>
Returns a tuple containing the height and width of the current terminal.
-
#snake_case(klass) ⇒ String
included
from Common
private
Converts a class name to a lowercase snake case string.
-
#stream_model? ⇒ Boolean
included
from Common
private
Returns a boolean indicating the model is a Views::Stream.
-
#string?(value) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether the value is a Fixnum.
-
#switch_mode!(mode = nil) ⇒ Symbol
included
from Mode
Changes the mode of the terminal to the mode given or toggles the terminal mode between ‘cooked`, `fake` and `raw`, depending on the current mode.
-
#truthy?(value) ⇒ Boolean
included
from Common
private
Returns a boolean indicating whether the value should be considered true.
-
#valid_mode?(mode) ⇒ Boolean
included
from Mode
private
Returns a boolean indicating whether the given mode is valid.
- #valid_modes ⇒ Array<Symbol> included from Mode private
-
#view_model? ⇒ Boolean
included
from Common
private
Returns a boolean indicating the model is a Views::View.
Class Method Details
.absent?(variable) ⇒ Boolean Originally defined in module Common
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.
Returns a boolean indicating whether a variable is nil or empty.
.become(klass, attributes) ⇒ Class Originally defined in module Common
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.
Converts one class into another.
.boolean(value) ⇒ Boolean Originally defined in module Common
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.
Returns a boolean indicating the value was a boolean.
.boolean?(value) ⇒ Boolean Originally defined in module Common
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.
Returns a boolean indicating whether the value is a Boolean.
.centre ⇒ Array
Returns a coordinate tuple of the format [y, x], where ‘y` is the row/line and `x` is the column/character.
116 117 118 |
# File 'lib/vedeu/terminal/terminal.rb', line 116 def centre [(height / 2), (width / 2)] end |
.centre_x ⇒ Fixnum
Returns the ‘x` (column/character) component of the coodinate tuple provided by centre
132 133 134 |
# File 'lib/vedeu/terminal/terminal.rb', line 132 def centre_x centre[-1] end |
.centre_y ⇒ Fixnum
Returns the ‘y` (row/line) component of the coordinate tuple provided by centre
124 125 126 |
# File 'lib/vedeu/terminal/terminal.rb', line 124 def centre_y centre[0] end |
.clear ⇒ String
Clears the entire terminal space.
90 91 92 |
# File 'lib/vedeu/terminal/terminal.rb', line 90 def clear output(Vedeu.esc.clear) end |
.console ⇒ File
Provides our gateway into the wonderful rainbow-filled world of IO.
158 159 160 |
# File 'lib/vedeu/terminal/terminal.rb', line 158 def console IO.console end |
.cooked_mode! ⇒ Symbol Originally defined in module Mode
Sets the terminal in to ‘cooked` mode.
.cooked_mode? ⇒ Boolean Originally defined in module Mode
Returns a boolean indicating whether the terminal is currently in ‘cooked` mode.
.debugging! ⇒ String
Disables the mouse and shows the cursor.
80 81 82 |
# File 'lib/vedeu/terminal/terminal.rb', line 80 def debugging! output(Vedeu.esc.mouse_x10_off + Vedeu.esc.show_cursor) end |
.escape?(value) ⇒ Boolean Originally defined in module Common
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.
Returns a boolean indicating whether the value is an escape sequence object (e.g. Vedeu::Cells::Escape.)
.fake_mode! ⇒ Symbol Originally defined in module Mode
Sets the terminal in to ‘fake` mode.
.fake_mode? ⇒ Boolean Originally defined in module Mode
Returns a boolean indicating whether the terminal is currently in ‘fake` mode.
.falsy?(value) ⇒ Boolean Originally defined in module Common
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.
Returns a boolean indicating whether the value should be considered false.
.hash?(value) ⇒ Boolean Originally defined in module Common
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.
Returns a boolean indicating whether the value is a Hash.
.initialize_screen(mode, &block) ⇒ void
This method returns an undefined value.
69 70 71 72 73 74 75 |
# File 'lib/vedeu/terminal/terminal.rb', line 69 def initialize_screen(mode, &block) Vedeu.log(message: "Terminal entering '#{mode}' mode") output(Vedeu.esc.screen_init) yield if block_given? end |
.line_model? ⇒ Boolean Originally defined in module Common
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.
Returns a boolean indicating the model is a Views::Line.
.mode ⇒ Symbol Originally defined in module Mode
Returns the mode of the terminal, either ‘:cooked`, `:fake` or `:raw`. Can change throughout the lifespan of the client application.
.numeric?(value) ⇒ Boolean Originally defined in module Common
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.
Returns a boolean indicating whether the value is a Fixnum.
.open(&block) ⇒ Array
Opens a terminal screen in either ‘raw` or `cooked` mode. On exit, attempts to restore the screen. See #restore_screen.
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/vedeu/terminal/terminal.rb', line 28 def open(&block) fail Vedeu::Error::RequiresBlock unless block_given? if raw_mode? || fake_mode? console.raw { initialize_screen(mode) { yield } } else console.cooked { initialize_screen(mode) { yield } } end ensure restore_screen end |
.origin ⇒ Fixnum Also known as: tx, ty
Returns 1. This 1 is either the top-most or left-most coordinate of the terminal.
140 141 142 |
# File 'lib/vedeu/terminal/terminal.rb', line 140 def origin 1 end |
.output(*streams) ⇒ Array Also known as: write
Prints the streams to the screen and returns the streams.
46 47 48 49 50 51 52 53 |
# File 'lib/vedeu/terminal/terminal.rb', line 46 def output(*streams) streams.each do |stream| Vedeu.log(type: :output, message: "Writing to terminal #{stream.size} bytes") console.print(stream) end end |
.present?(variable) ⇒ Boolean Originally defined in module Common
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.
Returns a boolean indicating whether a variable has a useful value.
.raw_mode! ⇒ Symbol Originally defined in module Mode
Sets the terminal in to ‘raw` mode.
.raw_mode? ⇒ Boolean Originally defined in module Mode
Returns a boolean indicating whether the terminal is currently in ‘raw` mode.
.resize ⇒ Boolean
58 59 60 61 62 63 64 |
# File 'lib/vedeu/terminal/terminal.rb', line 58 def resize Vedeu.trigger(:_clear_) Vedeu.trigger(:_refresh_) true end |
.restore_screen ⇒ String
Attempts to tidy up the screen just before the application terminates. The cursor is shown, colours are reset to terminal defaults, the terminal is told to reset, and finally we clear the last line ready for the prompt.
100 101 102 |
# File 'lib/vedeu/terminal/terminal.rb', line 100 def restore_screen output(Vedeu.esc.screen_exit) end |
.set_cursor_mode ⇒ String
Sets the cursor to be visible unless in raw mode, whereby it will be left hidden.
108 109 110 |
# File 'lib/vedeu/terminal/terminal.rb', line 108 def set_cursor_mode output(Vedeu.esc.show_cursor) unless raw_mode? end |
.size ⇒ Array<Fixnum>
Returns a tuple containing the height and width of the current terminal.
150 151 152 |
# File 'lib/vedeu/terminal/terminal.rb', line 150 def size console.winsize end |
.snake_case(klass) ⇒ String Originally defined in module Common
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.
Converts a class name to a lowercase snake case string.
.stream_model? ⇒ Boolean Originally defined in module Common
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.
Returns a boolean indicating the model is a Views::Stream.
.string?(value) ⇒ Boolean Originally defined in module Common
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.
Returns a boolean indicating whether the value is a Fixnum.
.switch_mode!(mode = nil) ⇒ Symbol Originally defined in module Mode
Changes the mode of the terminal to the mode given or toggles the terminal mode between ‘cooked`, `fake` and `raw`, depending on the current mode.
.truthy?(value) ⇒ Boolean Originally defined in module Common
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.
Returns a boolean indicating whether the value should be considered true.
.valid_mode?(mode) ⇒ Boolean (private) Originally defined in module Mode
Returns a boolean indicating whether the given mode is valid.
.valid_modes ⇒ Array<Symbol> (private) Originally defined in module Mode
.view_model? ⇒ Boolean Originally defined in module Common
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.
Returns a boolean indicating the model is a Views::View.
Instance Method Details
#absent?(variable) ⇒ Boolean Originally defined in module Common
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.
Returns a boolean indicating whether a variable is nil or empty.
#become(klass, attributes) ⇒ Class Originally defined in module Common
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.
Converts one class into another.
#boolean(value) ⇒ Boolean Originally defined in module Common
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.
Returns a boolean indicating the value was a boolean.
#boolean?(value) ⇒ Boolean Originally defined in module Common
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.
Returns a boolean indicating whether the value is a Boolean.
#centre ⇒ Array
Returns a coordinate tuple of the format [y, x], where ‘y` is the row/line and `x` is the column/character.
116 117 118 |
# File 'lib/vedeu/terminal/terminal.rb', line 116 def centre [(height / 2), (width / 2)] end |
#centre_x ⇒ Fixnum
Returns the ‘x` (column/character) component of the coodinate tuple provided by centre
132 133 134 |
# File 'lib/vedeu/terminal/terminal.rb', line 132 def centre_x centre[-1] end |
#centre_y ⇒ Fixnum
Returns the ‘y` (row/line) component of the coordinate tuple provided by centre
124 125 126 |
# File 'lib/vedeu/terminal/terminal.rb', line 124 def centre_y centre[0] end |
#clear ⇒ String
Clears the entire terminal space.
90 91 92 |
# File 'lib/vedeu/terminal/terminal.rb', line 90 def clear output(Vedeu.esc.clear) end |
#console ⇒ File
Provides our gateway into the wonderful rainbow-filled world of IO.
158 159 160 |
# File 'lib/vedeu/terminal/terminal.rb', line 158 def console IO.console end |
#cooked_mode! ⇒ Symbol Originally defined in module Mode
Sets the terminal in to ‘cooked` mode.
#cooked_mode? ⇒ Boolean Originally defined in module Mode
Returns a boolean indicating whether the terminal is currently in ‘cooked` mode.
#debugging! ⇒ String
Disables the mouse and shows the cursor.
80 81 82 |
# File 'lib/vedeu/terminal/terminal.rb', line 80 def debugging! output(Vedeu.esc.mouse_x10_off + Vedeu.esc.show_cursor) end |
#escape?(value) ⇒ Boolean Originally defined in module Common
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.
Returns a boolean indicating whether the value is an escape sequence object (e.g. Vedeu::Cells::Escape.)
#fake_mode! ⇒ Symbol Originally defined in module Mode
Sets the terminal in to ‘fake` mode.
#fake_mode? ⇒ Boolean Originally defined in module Mode
Returns a boolean indicating whether the terminal is currently in ‘fake` mode.
#falsy?(value) ⇒ Boolean Originally defined in module Common
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.
Returns a boolean indicating whether the value should be considered false.
#hash?(value) ⇒ Boolean Originally defined in module Common
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.
Returns a boolean indicating whether the value is a Hash.
#initialize_screen(mode, &block) ⇒ void
This method returns an undefined value.
69 70 71 72 73 74 75 |
# File 'lib/vedeu/terminal/terminal.rb', line 69 def initialize_screen(mode, &block) Vedeu.log(message: "Terminal entering '#{mode}' mode") output(Vedeu.esc.screen_init) yield if block_given? end |
#line_model? ⇒ Boolean Originally defined in module Common
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.
Returns a boolean indicating the model is a Views::Line.
#mode ⇒ Symbol Originally defined in module Mode
Returns the mode of the terminal, either ‘:cooked`, `:fake` or `:raw`. Can change throughout the lifespan of the client application.
#numeric?(value) ⇒ Boolean Originally defined in module Common
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.
Returns a boolean indicating whether the value is a Fixnum.
#open(&block) ⇒ Array
Opens a terminal screen in either ‘raw` or `cooked` mode. On exit, attempts to restore the screen. See #restore_screen.
28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/vedeu/terminal/terminal.rb', line 28 def open(&block) fail Vedeu::Error::RequiresBlock unless block_given? if raw_mode? || fake_mode? console.raw { initialize_screen(mode) { yield } } else console.cooked { initialize_screen(mode) { yield } } end ensure restore_screen end |
#origin ⇒ Fixnum Also known as: tx, ty
Returns 1. This 1 is either the top-most or left-most coordinate of the terminal.
140 141 142 |
# File 'lib/vedeu/terminal/terminal.rb', line 140 def origin 1 end |
#output(*streams) ⇒ Array Also known as: write
Prints the streams to the screen and returns the streams.
46 47 48 49 50 51 52 53 |
# File 'lib/vedeu/terminal/terminal.rb', line 46 def output(*streams) streams.each do |stream| Vedeu.log(type: :output, message: "Writing to terminal #{stream.size} bytes") console.print(stream) end end |
#present?(variable) ⇒ Boolean Originally defined in module Common
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.
Returns a boolean indicating whether a variable has a useful value.
#raw_mode! ⇒ Symbol Originally defined in module Mode
Sets the terminal in to ‘raw` mode.
#raw_mode? ⇒ Boolean Originally defined in module Mode
Returns a boolean indicating whether the terminal is currently in ‘raw` mode.
#resize ⇒ Boolean
58 59 60 61 62 63 64 |
# File 'lib/vedeu/terminal/terminal.rb', line 58 def resize Vedeu.trigger(:_clear_) Vedeu.trigger(:_refresh_) true end |
#restore_screen ⇒ String
Attempts to tidy up the screen just before the application terminates. The cursor is shown, colours are reset to terminal defaults, the terminal is told to reset, and finally we clear the last line ready for the prompt.
100 101 102 |
# File 'lib/vedeu/terminal/terminal.rb', line 100 def restore_screen output(Vedeu.esc.screen_exit) end |
#set_cursor_mode ⇒ String
Sets the cursor to be visible unless in raw mode, whereby it will be left hidden.
108 109 110 |
# File 'lib/vedeu/terminal/terminal.rb', line 108 def set_cursor_mode output(Vedeu.esc.show_cursor) unless raw_mode? end |
#size ⇒ Array<Fixnum>
Returns a tuple containing the height and width of the current terminal.
150 151 152 |
# File 'lib/vedeu/terminal/terminal.rb', line 150 def size console.winsize end |
#snake_case(klass) ⇒ String Originally defined in module Common
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.
Converts a class name to a lowercase snake case string.
#stream_model? ⇒ Boolean Originally defined in module Common
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.
Returns a boolean indicating the model is a Views::Stream.
#string?(value) ⇒ Boolean Originally defined in module Common
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.
Returns a boolean indicating whether the value is a Fixnum.
#switch_mode!(mode = nil) ⇒ Symbol Originally defined in module Mode
Changes the mode of the terminal to the mode given or toggles the terminal mode between ‘cooked`, `fake` and `raw`, depending on the current mode.
#truthy?(value) ⇒ Boolean Originally defined in module Common
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.
Returns a boolean indicating whether the value should be considered true.
#valid_mode?(mode) ⇒ Boolean (private) Originally defined in module Mode
Returns a boolean indicating whether the given mode is valid.
#valid_modes ⇒ Array<Symbol> (private) Originally defined in module Mode
#view_model? ⇒ Boolean Originally defined in module Common
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.
Returns a boolean indicating the model is a Views::View.