Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/ruby2d/cli/colorize.rb
Overview
Extend ‘String` to include some fancy colors
Instance Method Summary collapse
- #bold ⇒ Object
- #error ⇒ Object
- #info ⇒ Object
- #ruby2d_colorize(c) ⇒ Object
- #success ⇒ Object
- #warn ⇒ Object
Instance Method Details
#bold ⇒ Object
6 |
# File 'lib/ruby2d/cli/colorize.rb', line 6 def bold; ruby2d_colorize('1') end |
#error ⇒ Object
10 |
# File 'lib/ruby2d/cli/colorize.rb', line 10 def error; ruby2d_colorize('1;31') end |
#info ⇒ Object
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 |
#success ⇒ Object
9 |
# File 'lib/ruby2d/cli/colorize.rb', line 9 def success; ruby2d_colorize('1;32') end |
#warn ⇒ Object
8 |
# File 'lib/ruby2d/cli/colorize.rb', line 8 def warn; ruby2d_colorize('1;33') end |