Class: String

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

Constant Summary collapse

COLORS =
{ red: 31,
  green: 32,
  yellow: 33,
  blue: 34,
  pink: 35
}

Instance Method Summary collapse

Instance Method Details

#colorize(color_code) ⇒ Object

colorization



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

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