Sha256: 86c05a73c730f4160e1aa5bb461dab82c4ec199c7728af4590501ec1de3e01d0
Contents?: true
Size: 513 Bytes
Versions: 17
Compression:
Stored size: 513 Bytes
Contents
## # Meta-programming String for Syntactic Sugars class String # @param [Fixnum] color_code ANSI color code # @return [String] colored string def colorize(color_code) "\e[#{color_code}m#{self}\e[0m" end # color the string with red color def red colorize(31) end # color the string with green color def green colorize(32) end # color the string with yellow color def yellow colorize(33) end # color the string with blue color def blue colorize(34) end end
Version data entries
17 entries across 17 versions & 1 rubygems