Class: ConsoleManager

Inherits:
Object
  • Object
show all
Includes:
TerminalUtils
Defined in:
lib/views.rb

Constant Summary

Constants included from TerminalUtils

TerminalUtils::ERASE_DISPLAY, TerminalUtils::GREEN, TerminalUtils::RED, TerminalUtils::RESET, TerminalUtils::RESTORE_CURSOR, TerminalUtils::SAVE_CURSOR, TerminalUtils::SCREEN_WIDTH

Class Method Summary collapse

Class Method Details

.error(message) ⇒ Object



24
25
26
27
# File 'lib/views.rb', line 24

def self.error(message)
  puts RED + message + RESET
  exit
end

.repaint(rows) ⇒ Object



18
19
20
21
22
# File 'lib/views.rb', line 18

def self.repaint(rows)
  print RESTORE_CURSOR
  num_rows = rows.flat_map(&:to_s).length
  rows.each { |row| puts row.to_s; puts }
end