Module: Degica::ANSI

Defined in:
lib/degica/ansi.rb

Constant Summary collapse

COLORS =
{
  none: "\e[0m",
  yellow: "\e[1;33m",
  red: "\e[31m",
  white: "\e[3;1m"
}

Class Method Summary collapse

Class Method Details

.clear_screenObject



11
12
13
# File 'lib/degica/ansi.rb', line 11

def clear_screen
  puts "\x1b[2J"
end

.highlight(word, color) ⇒ Object



15
16
17
# File 'lib/degica/ansi.rb', line 15

def highlight(word, color)
  COLORS[color] + word + COLORS[:none]
end