Module: RBText::Screen

Included in:
S
Defined in:
lib/rbtext/screen.rb

Constant Summary collapse

@@methods =
[
  :clear,
  :clear_line,
  :size,
  :height,
  :width
]

Instance Method Summary collapse

Instance Method Details

#clearObject



11
12
13
# File 'lib/rbtext/screen.rb', line 11

def clear
  print "\033[2J"
end

#clear_lineObject



15
16
17
# File 'lib/rbtext/screen.rb', line 15

def clear_line
  print "\033[2K"
end

#heightObject



23
24
25
# File 'lib/rbtext/screen.rb', line 23

def height
  self.size[0]
end

#sizeObject



19
20
21
# File 'lib/rbtext/screen.rb', line 19

def size
  IO.console.winsize
end

#widthObject



27
28
29
# File 'lib/rbtext/screen.rb', line 27

def width
  self.size[1]
end