Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/string.rb
Instance Method Summary collapse
- #blue ⇒ Object
- #colorize(color_code) ⇒ Object
- #gray ⇒ Object
- #green ⇒ Object
- #orange ⇒ Object
- #yellow ⇒ Object
Instance Method Details
#blue ⇒ Object
18 19 20 |
# File 'lib/string.rb', line 18 def blue colorize(46) end |
#colorize(color_code) ⇒ Object
2 3 4 |
# File 'lib/string.rb', line 2 def colorize(color_code) "\e[#{color_code}m#{self}\e[0m" end |
#gray ⇒ Object
14 15 16 |
# File 'lib/string.rb', line 14 def gray colorize(47) end |
#green ⇒ Object
6 7 8 |
# File 'lib/string.rb', line 6 def green colorize(42) end |
#orange ⇒ Object
22 23 24 |
# File 'lib/string.rb', line 22 def orange "\033[48:2:255:165:0m#{self}\033[m" end |
#yellow ⇒ Object
10 11 12 |
# File 'lib/string.rb', line 10 def yellow colorize(43) end |