Class: String

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

Instance Method Summary collapse

Instance Method Details

#colorize(color_code) ⇒ Object



2
3
4
# File 'lib/credy/string.rb', line 2

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

#greenObject



10
11
12
# File 'lib/credy/string.rb', line 10

def green
  colorize 32
end

#redObject



6
7
8
# File 'lib/credy/string.rb', line 6

def red
  colorize 31
end