Class: String

Inherits:
Object show all
Defined in:
lib/slimkeyfy/console/printer.rb

Instance Method Summary collapse

Instance Method Details

#colorize(color_code) ⇒ Object



35
36
37
# File 'lib/slimkeyfy/console/printer.rb', line 35

def colorize(color_code)
  "\e[#{color_code}m#{self}\e[0m"
end

#greenObject



41
42
43
# File 'lib/slimkeyfy/console/printer.rb', line 41

def green
  colorize(32)
end

#redObject



38
39
40
# File 'lib/slimkeyfy/console/printer.rb', line 38

def red
  colorize(31)
end

#whiteObject



47
48
49
# File 'lib/slimkeyfy/console/printer.rb', line 47

def white
  colorize(37)
end

#yellowObject



44
45
46
# File 'lib/slimkeyfy/console/printer.rb', line 44

def yellow
  colorize(34)
end