Class: Clite::Screen

Inherits:
Object
  • Object
show all
Defined in:
lib/clite.rb

Instance Method Summary collapse

Constructor Details

#initializeScreen

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