Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/dply/ext/string.rb
Instance Method Summary collapse
- #blue ⇒ Object
- #bold ⇒ Object
- #colorize(color_code) ⇒ Object
- #green ⇒ Object
- #grey ⇒ Object
- #red ⇒ Object
- #white ⇒ Object
- #yellow ⇒ Object
Instance Method Details
#blue ⇒ Object
26 27 28 |
# File 'lib/dply/ext/string.rb', line 26 def blue colorize(34) end |
#bold ⇒ Object
6 7 8 |
# File 'lib/dply/ext/string.rb', line 6 def bold "\e[1m#{self}\e[0m" end |
#colorize(color_code) ⇒ Object
2 3 4 |
# File 'lib/dply/ext/string.rb', line 2 def colorize(color_code) "\e[#{color_code}m#{self}\e[0m" end |
#green ⇒ Object
14 15 16 |
# File 'lib/dply/ext/string.rb', line 14 def green colorize(32) end |
#grey ⇒ Object
30 31 32 |
# File 'lib/dply/ext/string.rb', line 30 def grey colorize("90") end |
#red ⇒ Object
22 23 24 |
# File 'lib/dply/ext/string.rb', line 22 def red colorize(31) end |
#white ⇒ Object
10 11 12 |
# File 'lib/dply/ext/string.rb', line 10 def white colorize(37) end |
#yellow ⇒ Object
18 19 20 |
# File 'lib/dply/ext/string.rb', line 18 def yellow colorize(33) end |