Module: JumpStart::StringTools
- Included in:
- String
- Defined in:
- lib/jumpstart/stringtools.rb
Instance Method Summary collapse
- #blue ⇒ Object
- #blue_bold ⇒ Object
- #colourise(text, colour_code) ⇒ Object
- #green ⇒ Object
- #green_bold ⇒ Object
- #purple ⇒ Object
-
#red ⇒ Object
Self explanatory methods to be called on strings that changes output colour.
- #red_bold ⇒ Object
- #yellow ⇒ Object
Instance Method Details
#blue ⇒ Object
9 |
# File 'lib/jumpstart/stringtools.rb', line 9 def blue; colourise(self, "\e[34m"); end |
#blue_bold ⇒ Object
10 |
# File 'lib/jumpstart/stringtools.rb', line 10 def blue_bold; colourise(self, "\e[1m\e[34m"); end |
#colourise(text, colour_code) ⇒ Object
13 |
# File 'lib/jumpstart/stringtools.rb', line 13 def colourise(text, colour_code) "#{colour_code}#{text}\e[0m" end |
#green ⇒ Object
6 |
# File 'lib/jumpstart/stringtools.rb', line 6 def green; colourise(self, "\e[32m"); end |
#green_bold ⇒ Object
7 |
# File 'lib/jumpstart/stringtools.rb', line 7 def green_bold; colourise(self, "\e[1m\e[32m"); end |
#purple ⇒ Object
11 |
# File 'lib/jumpstart/stringtools.rb', line 11 def purple; colourise(self, "\e[1m\e[35m"); end |
#red ⇒ Object
Self explanatory methods to be called on strings that changes output colour.
4 |
# File 'lib/jumpstart/stringtools.rb', line 4 def red; colourise(self, "\e[31m"); end |
#red_bold ⇒ Object
5 |
# File 'lib/jumpstart/stringtools.rb', line 5 def red_bold; colourise(self, "\e[1m\e[31m"); end |
#yellow ⇒ Object
8 |
# File 'lib/jumpstart/stringtools.rb', line 8 def yellow; colourise(self, "\e[1m\e[33m"); end |