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