summaryrefslogtreecommitdiff
path: root/lib/highline/terminal/io_console.rb
diff options
context:
space:
mode:
authorAbinoam Praxedes Marques Jr <abinoam@gmail.com>2015-12-14 08:10:29 -0300
committerAbinoam Praxedes Marques Jr <abinoam@gmail.com>2015-12-14 08:29:16 -0300
commitc66300ef64f0fb22b819625d41e403a157f9c4d1 (patch)
treef4144645370841d5c092ffa5dccb386603b925f9 /lib/highline/terminal/io_console.rb
parentda1cdee25d4cae9ec3f85ae131a5dfbc306ba97c (diff)
downloadhighline-c66300ef64f0fb22b819625d41e403a157f9c4d1.tar.gz
Improve HighLine::Terminal and childs documentation
Diffstat (limited to 'lib/highline/terminal/io_console.rb')
-rw-r--r--lib/highline/terminal/io_console.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/highline/terminal/io_console.rb b/lib/highline/terminal/io_console.rb
index c66f81e..b39e675 100644
--- a/lib/highline/terminal/io_console.rb
+++ b/lib/highline/terminal/io_console.rb
@@ -2,25 +2,34 @@
class HighLine
class Terminal
+ # io/console option for HighLine::Terminal.
+ # It's the most used terminal.
class IOConsole < Terminal
+ # (see Terminal#terminal_size)
def terminal_size
output.winsize.reverse
end
+ # Easy to query active terminal (character mode).
+ # For debugging purposes.
CHARACTER_MODE = "io_console" # For Debugging purposes only.
+ # (see Terminal#raw_no_echo_mode)
def raw_no_echo_mode
input.echo = false
end
+ # (see Terminal#restore_mode)
def restore_mode
input.echo = true
end
+ # (see Terminal#get_character)
def get_character
input.getch # from ruby io/console
end
+ # Same as CHARACTER_MODE constant. "io_console"
def character_mode
"io_console"
end