Module: Screen

Extended by:
Screen
Included in:
Screen
Defined in:
lib/screen.rb

Instance Method Summary collapse

Instance Method Details

#clear!Object



4
5
6
# File 'lib/screen.rb', line 4

def clear!
  print "\e[2J\e[f"
end

#heightObject



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

def height
  `tput lines`.to_i
end

#hide_cursorObject



8
9
10
# File 'lib/screen.rb', line 8

def hide_cursor
  print "\e[#{height};#{width}H"
end


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

def print(text)
  Kernel.print text
end

#suggest(x, y) ⇒ Object



20
21
22
23
24
25
# File 'lib/screen.rb', line 20

def suggest(x, y)
  y.times do |n|
    print "\n" if n.nonzero?
    print "\u2588" * x
  end
end

#widthObject



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

def width
  `tput cols`.to_i
end