Class: TTY::Terminal
- Inherits:
-
Object
- Object
- TTY::Terminal
- Defined in:
- lib/tty/terminal.rb,
lib/tty/terminal/echo.rb,
lib/tty/terminal/home.rb,
lib/tty/terminal/pager.rb,
lib/tty/terminal/pager/basic.rb,
lib/tty/terminal/pager/system.rb
Defined Under Namespace
Classes: BasicPager, Echo, Home, Pager, SystemPager
Instance Attribute Summary collapse
-
#color ⇒ TTY::Terminal::Color
readonly
Return access to color terminal.
-
#pager ⇒ TTY::Terminal::Pager
readonly
Output pager.
Instance Method Summary collapse
-
#echo(is_on = true, &block) ⇒ Object
Echo given block.
-
#echo_off ⇒ Object
Switch echo off.
-
#echo_on ⇒ Object
Switch echo on.
-
#home ⇒ String
Find user home directory.
-
#initialize(options = {}) ⇒ Terminal
constructor
Initialize a Terminal.
-
#page(text) ⇒ Object
Run text through a dynamically chosen pager.
Constructor Details
Instance Attribute Details
#color ⇒ TTY::Terminal::Color (readonly)
Return access to color terminal
10 11 12 |
# File 'lib/tty/terminal.rb', line 10 def color @color end |
#pager ⇒ TTY::Terminal::Pager (readonly)
Output pager
17 18 19 |
# File 'lib/tty/terminal.rb', line 17 def pager @pager end |
Instance Method Details
#echo(is_on = true, &block) ⇒ Object
Echo given block
48 49 50 |
# File 'lib/tty/terminal.rb', line 48 def echo(is_on = true, &block) @echo.echo(is_on, &block) end |
#echo_off ⇒ Object
Switch echo off
39 40 41 |
# File 'lib/tty/terminal.rb', line 39 def echo_off @echo.off end |
#echo_on ⇒ Object
Switch echo on
32 33 34 |
# File 'lib/tty/terminal.rb', line 32 def echo_on @echo.on end |
#home ⇒ String
Find user home directory
57 58 59 |
# File 'lib/tty/terminal.rb', line 57 def home @home.home end |
#page(text) ⇒ Object
Run text through a dynamically chosen pager
67 68 69 |
# File 'lib/tty/terminal.rb', line 67 def page(text) @pager.page(text) end |