Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby2d/cli/colorize.rb

Overview

Extend ‘String` to include some fancy colors

Instance Method Summary collapse

Instance Method Details

#boldObject



6
# File 'lib/ruby2d/cli/colorize.rb', line 6

def bold;    ruby2d_colorize('1')    end

#errorObject



10
# File 'lib/ruby2d/cli/colorize.rb', line 10

def error;   ruby2d_colorize('1;31') end

#infoObject



7
# File 'lib/ruby2d/cli/colorize.rb', line 7

def info;    ruby2d_colorize('1;34') end

#ruby2d_colorize(c) ⇒ Object



5
# File 'lib/ruby2d/cli/colorize.rb', line 5

def ruby2d_colorize(c); "\e[#{c}m#{self}\e[0m" end

#successObject



9
# File 'lib/ruby2d/cli/colorize.rb', line 9

def success; ruby2d_colorize('1;32') end

#warnObject



8
# File 'lib/ruby2d/cli/colorize.rb', line 8

def warn;    ruby2d_colorize('1;33') end