Class: Clite::Screen
- Inherits:
-
Object
- Object
- Clite::Screen
- Defined in:
- lib/clite.rb
Instance Method Summary collapse
-
#initialize ⇒ Screen
constructor
A new instance of Screen.
- #update(state = '') ⇒ Object
Constructor Details
#initialize ⇒ Screen
Returns a new instance of Screen.
19 20 21 22 23 24 25 |
# File 'lib/clite.rb', line 19 def initialize rows_size, columns_size = STDIN.winsize @rows = Array.new(rows_size) { String.new capacity: columns_size } @rows[1] = '-' * columns_size @rows[3] = '-' * columns_size end |
Instance Method Details
#update(state = '') ⇒ Object
27 28 29 30 31 |
# File 'lib/clite.rb', line 27 def update state = '' char = state update_line_with char render_rows end |