class String

String Class

Public Instance Methods

blue() click to toggle source
# File lib/cliutils/ext/String+Extensions.rb, line 19
def blue; colorize(34) end
colorize(color_code) click to toggle source

Color String Methods


colorize method

Outputs a string in a formatted color. @param color_code The code to use @return Void


# File lib/cliutils/ext/String+Extensions.rb, line 15
def colorize(color_code)
  "\033[#{ color_code }m#{ self }\033[0m"
end
cyan() click to toggle source
# File lib/cliutils/ext/String+Extensions.rb, line 20
def cyan; colorize(36) end
green() click to toggle source
# File lib/cliutils/ext/String+Extensions.rb, line 21
def green; colorize(32) end
purple() click to toggle source
# File lib/cliutils/ext/String+Extensions.rb, line 22
def purple; colorize(35) end
red() click to toggle source
# File lib/cliutils/ext/String+Extensions.rb, line 23
def red; colorize(31) end
white() click to toggle source
# File lib/cliutils/ext/String+Extensions.rb, line 24
def white; colorize(37) end
yellow() click to toggle source
# File lib/cliutils/ext/String+Extensions.rb, line 25
def yellow; colorize(33) end