Module: RBText::Screen

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

Constant Summary collapse

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

Instance Method Summary collapse

Instance Method Details

#bellObject



32
33
34
# File 'lib/rbtext/screen.rb', line 32

def bell
  print "\a"
end

#clearObject



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

def clear
  print "\033[2J"
end

#clear_lineObject



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

def clear_line
  print "\033[2K"
end

#heightObject



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

def height
  self.size[0]
end

#sizeObject



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

def size
  IO.console.winsize
end

#widthObject



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

def width
  self.size[1]
end