Module: Screen
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 |
#height ⇒ Object
12 13 14 |
# File 'lib/screen.rb', line 12 def height `tput lines`.to_i end |
#hide_cursor ⇒ Object
8 9 10 |
# File 'lib/screen.rb', line 8 def hide_cursor print "\e[#{height};#{width}H" end |
#suggest(x, y) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/screen.rb', line 16 def suggest(x, y) y.times do |n| print "\n" if n.nonzero? print "\u2588" * x end end |
#width ⇒ Object
23 24 25 |
# File 'lib/screen.rb', line 23 def width `tput cols`.to_i end |