Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/core_extensions/string.rb
Instance Method Summary collapse
- #black ⇒ Object
- #blink ⇒ Object
- #bold ⇒ Object
- #cyan ⇒ Object
- #green ⇒ Object
- #italic ⇒ Object
- #no_colors ⇒ Object
- #red ⇒ Object
Instance Method Details
#black ⇒ Object
4 5 6 |
# File 'lib/core_extensions/string.rb', line 4 def black "\e[30m#{self}\e[0m" end |
#blink ⇒ Object
28 29 30 |
# File 'lib/core_extensions/string.rb', line 28 def blink "\e[5m#{self}\e[25m" end |
#bold ⇒ Object
20 21 22 |
# File 'lib/core_extensions/string.rb', line 20 def bold "\e[1m#{self}\e[22m" end |
#cyan ⇒ Object
16 17 18 |
# File 'lib/core_extensions/string.rb', line 16 def cyan "\e[36m#{self}\e[0m" end |
#green ⇒ Object
12 13 14 |
# File 'lib/core_extensions/string.rb', line 12 def green "\e[32m#{self}\e[0m" end |
#italic ⇒ Object
24 25 26 |
# File 'lib/core_extensions/string.rb', line 24 def italic "\e[3m#{self}\e[23m" end |
#no_colors ⇒ Object
32 33 34 |
# File 'lib/core_extensions/string.rb', line 32 def no_colors gsub(/\e\[\d+m/, '') end |
#red ⇒ Object
8 9 10 |
# File 'lib/core_extensions/string.rb', line 8 def red "\e[31m#{self}\e[0m" end |