Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/generamba/tools/string-colorize.rb
Overview
Adds a number of methods for colorizing output strings
Instance Method Summary collapse
Instance Method Details
#blue ⇒ Object
20 21 22 |
# File 'lib/generamba/tools/string-colorize.rb', line 20 def blue colorize(34) end |
#colorize(color_code) ⇒ Object
4 5 6 |
# File 'lib/generamba/tools/string-colorize.rb', line 4 def colorize(color_code) "\e[#{color_code}m#{self}\e[0m" end |
#green ⇒ Object
12 13 14 |
# File 'lib/generamba/tools/string-colorize.rb', line 12 def green colorize(32) end |
#red ⇒ Object
8 9 10 |
# File 'lib/generamba/tools/string-colorize.rb', line 8 def red colorize(31) end |
#yellow ⇒ Object
16 17 18 |
# File 'lib/generamba/tools/string-colorize.rb', line 16 def yellow colorize(33) end |