Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/colorize.rb
Instance Method Summary collapse
-
#colorize(text, color_code) ⇒ Object
colorization.
- #green ⇒ Object
- #red ⇒ Object
Instance Method Details
#colorize(text, color_code) ⇒ Object
colorization
5 6 7 |
# File 'lib/colorize.rb', line 5 def colorize(text, color_code) "\e[#{color_code}m#{text}\e[0m" end |
#green ⇒ Object
13 14 15 |
# File 'lib/colorize.rb', line 13 def green colorize(self, 32) end |
#red ⇒ Object
9 10 11 |
# File 'lib/colorize.rb', line 9 def red colorize(self, 31) end |