Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/helpers.rb
Instance Method Summary collapse
- #blue ⇒ Object
- #colorize(text, color_code) ⇒ Object
- #dark_blue ⇒ Object
- #dark_green ⇒ Object
- #green ⇒ Object
- #pur ⇒ Object
- #red ⇒ Object
- #yellow ⇒ Object
Instance Method Details
#blue ⇒ Object
66 67 68 |
# File 'lib/helpers.rb', line 66 def blue colorize(self, "\e[1m\e[34m") end |
#colorize(text, color_code) ⇒ Object
78 79 80 81 82 83 84 |
# File 'lib/helpers.rb', line 78 def colorize(text, color_code) if $COLORIZE "#{color_code}#{text}\e[0m" else text end end |
#dark_blue ⇒ Object
70 71 72 |
# File 'lib/helpers.rb', line 70 def dark_blue colorize(self, "\e[34m") end |
#dark_green ⇒ Object
58 59 60 |
# File 'lib/helpers.rb', line 58 def dark_green colorize(self, "\e[32m") end |
#green ⇒ Object
54 55 56 |
# File 'lib/helpers.rb', line 54 def green colorize(self, "\e[1m\e[32m") end |
#pur ⇒ Object
74 75 76 |
# File 'lib/helpers.rb', line 74 def pur colorize(self, "\e[1m\e[35m") end |
#red ⇒ Object
50 51 52 |
# File 'lib/helpers.rb', line 50 def red colorize(self, "\e[1m\e[31m") end |
#yellow ⇒ Object
62 63 64 |
# File 'lib/helpers.rb', line 62 def yellow colorize(self, "\e[1m\e[33m") end |