Class: Console

Inherits:
Object
  • Object
show all
Defined in:
lib/thefox-ext/console.rb

Constant Summary collapse

CHAR_ESCAPE =
"\x1b"

Class Method Summary collapse

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_topObject



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_clearObject



30
31
32
# File 'lib/thefox-ext/console.rb', line 30

def self.line_clear
  print "\r#{CHAR_ESCAPE}[K"
end

.line_clear_rightObject



34
35
36
# File 'lib/thefox-ext/console.rb', line 34

def self.line_clear_right
  print "#{CHAR_ESCAPE}[0K"
end

.screen_clear_to_bottomObject



38
39
40
# File 'lib/thefox-ext/console.rb', line 38

def self.screen_clear_to_bottom
  print "#{CHAR_ESCAPE}[J"
end

.scroll_downObject



46
47
48
# File 'lib/thefox-ext/console.rb', line 46

def self.scroll_down
  print "#{CHAR_ESCAPE}[T"
end

.scroll_upObject



42
43
44
# File 'lib/thefox-ext/console.rb', line 42

def self.scroll_up
  print "#{CHAR_ESCAPE}[S"
end