Module: JumpStart::StringTools

Included in:
String
Defined in:
lib/jumpstart/stringtools.rb

Instance Method Summary collapse

Instance Method Details

#blueObject



9
# File 'lib/jumpstart/stringtools.rb', line 9

def blue;         colourise(self, "\e[34m"); end

#blue_boldObject



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

#greenObject



6
# File 'lib/jumpstart/stringtools.rb', line 6

def green;        colourise(self, "\e[32m"); end

#green_boldObject



7
# File 'lib/jumpstart/stringtools.rb', line 7

def green_bold;   colourise(self, "\e[1m\e[32m"); end

#purpleObject



11
# File 'lib/jumpstart/stringtools.rb', line 11

def purple;       colourise(self, "\e[1m\e[35m"); end

#redObject

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_boldObject



5
# File 'lib/jumpstart/stringtools.rb', line 5

def red_bold;     colourise(self, "\e[1m\e[31m"); end

#yellowObject



8
# File 'lib/jumpstart/stringtools.rb', line 8

def yellow;       colourise(self, "\e[1m\e[33m"); end