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
61 62 63 |
# File 'lib/helpers.rb', line 61 def blue colorize(self, "\e[1m\e[34m") end |
#colorize(text, color_code) ⇒ Object
73 74 75 76 77 78 79 |
# File 'lib/helpers.rb', line 73 def colorize(text, color_code) if $COLORIZE "#{color_code}#{text}\e[0m" else text end end |
#dark_blue ⇒ Object
65 66 67 |
# File 'lib/helpers.rb', line 65 def dark_blue colorize(self, "\e[34m") end |
#dark_green ⇒ Object
53 54 55 |
# File 'lib/helpers.rb', line 53 def dark_green colorize(self, "\e[32m") end |
#green ⇒ Object
49 50 51 |
# File 'lib/helpers.rb', line 49 def green colorize(self, "\e[1m\e[32m") end |
#pur ⇒ Object
69 70 71 |
# File 'lib/helpers.rb', line 69 def pur colorize(self, "\e[1m\e[35m") end |
#red ⇒ Object
45 46 47 |
# File 'lib/helpers.rb', line 45 def red colorize(self, "\e[1m\e[31m") end |
#yellow ⇒ Object
57 58 59 |
# File 'lib/helpers.rb', line 57 def yellow colorize(self, "\e[1m\e[33m") end |