Class: Console
- Inherits:
-
Object
- Object
- Console
- Defined in:
- lib/thefox-ext/console.rb
Constant Summary collapse
- CHAR_ESCAPE =
"\x1b"
Class Method Summary collapse
- .cursor_down(rows = 1) ⇒ Object
- .cursor_jump_to_column(col = 1) ⇒ Object
- .cursor_jump_to_top ⇒ Object
- .cursor_left(offset = 1) ⇒ Object
- .cursor_right(offset = 1) ⇒ Object
- .cursor_up(rows = 1) ⇒ Object
- .line_clear ⇒ Object
- .line_clear_right ⇒ Object
- .screen_clear_to_bottom ⇒ Object
- .scroll_down ⇒ Object
- .scroll_up ⇒ Object
Class Method Details
.cursor_down(rows = 1) ⇒ Object
10 11 12 |
# File 'lib/thefox-ext/console.rb', line 10 def self.cursor_down(rows = 1) print "#{CHAR_ESCAPE}[#{rows}B" end |
.cursor_jump_to_column(col = 1) ⇒ Object
18 19 20 |
# File 'lib/thefox-ext/console.rb', line 18 def self.cursor_jump_to_column(col = 1) print "#{CHAR_ESCAPE}[#{col}G" end |
.cursor_jump_to_top ⇒ Object
14 15 16 |
# File 'lib/thefox-ext/console.rb', line 14 def self.cursor_jump_to_top print "#{CHAR_ESCAPE}[1;1f" end |
.cursor_left(offset = 1) ⇒ Object
26 27 28 |
# File 'lib/thefox-ext/console.rb', line 26 def self.cursor_left(offset = 1) print "#{CHAR_ESCAPE}[#{offset}D" end |
.cursor_right(offset = 1) ⇒ Object
22 23 24 |
# File 'lib/thefox-ext/console.rb', line 22 def self.cursor_right(offset = 1) print "#{CHAR_ESCAPE}[#{offset}C" end |
.cursor_up(rows = 1) ⇒ Object
6 7 8 |
# File 'lib/thefox-ext/console.rb', line 6 def self.cursor_up(rows = 1) print "#{CHAR_ESCAPE}[#{rows}A" end |
.line_clear ⇒ Object
30 31 32 |
# File 'lib/thefox-ext/console.rb', line 30 def self.line_clear print "\r#{CHAR_ESCAPE}[K" end |
.line_clear_right ⇒ Object
34 35 36 |
# File 'lib/thefox-ext/console.rb', line 34 def self.line_clear_right print "#{CHAR_ESCAPE}[0K" end |
.screen_clear_to_bottom ⇒ Object
38 39 40 |
# File 'lib/thefox-ext/console.rb', line 38 def self.screen_clear_to_bottom print "#{CHAR_ESCAPE}[J" end |
.scroll_down ⇒ Object
46 47 48 |
# File 'lib/thefox-ext/console.rb', line 46 def self.scroll_down print "#{CHAR_ESCAPE}[T" end |
.scroll_up ⇒ Object
42 43 44 |
# File 'lib/thefox-ext/console.rb', line 42 def self.scroll_up print "#{CHAR_ESCAPE}[S" end |