Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/rs_api/patches/string.rb
Overview
monkey-patching string class to add colors.
Instance Method Summary collapse
-
#black ⇒ Object
1 is bold, 30 is black, 47 is white bg.
- #blue ⇒ Object
- #cyan ⇒ Object
- #green ⇒ Object
- #negative ⇒ Object
- #purple ⇒ Object
- #red ⇒ Object
- #white ⇒ Object
- #yellow ⇒ Object
Instance Method Details
#black ⇒ Object
1 is bold, 30 is black, 47 is white bg
10 11 12 |
# File 'lib/rs_api/patches/string.rb', line 10 def black "\033[1;30;47m#{self}\033[0m" end |
#blue ⇒ Object
26 27 28 |
# File 'lib/rs_api/patches/string.rb', line 26 def blue "\033[34m#{self}\033[0m" end |
#cyan ⇒ Object
34 35 36 |
# File 'lib/rs_api/patches/string.rb', line 34 def cyan "\033[36m#{self}\033[0m" end |
#green ⇒ Object
18 19 20 |
# File 'lib/rs_api/patches/string.rb', line 18 def green "\033[32m#{self}\033[0m" end |
#negative ⇒ Object
5 6 7 |
# File 'lib/rs_api/patches/string.rb', line 5 def negative "\033[7m#{self}\033[0m" end |
#purple ⇒ Object
30 31 32 |
# File 'lib/rs_api/patches/string.rb', line 30 def purple "\033[35m#{self}\033[0m" end |
#red ⇒ Object
14 15 16 |
# File 'lib/rs_api/patches/string.rb', line 14 def red "\033[31m#{self}\033[0m" end |
#white ⇒ Object
38 39 40 |
# File 'lib/rs_api/patches/string.rb', line 38 def white "\033[37m#{self}\033[0m" end |
#yellow ⇒ Object
22 23 24 |
# File 'lib/rs_api/patches/string.rb', line 22 def yellow "\033[33m#{self}\033[0m" end |