Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/stockery.rb

Instance Method Summary collapse

Instance Method Details

#colorize(text, color_code) ⇒ Object



24
25
26
# File 'lib/stockery.rb', line 24

def colorize(text, color_code)  
  "#{color_code}#{text}\e[0m" 
end

#greenObject



20
# File 'lib/stockery.rb', line 20

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

#green_bgObject



22
# File 'lib/stockery.rb', line 22

def green_bg; colorize(self, "\e[31m\e[42m"); end

#redObject



19
# File 'lib/stockery.rb', line 19

def red; colorize(self, "\e[31m"); end

#red_bgObject



21
# File 'lib/stockery.rb', line 21

def red_bg; colorize(self, "\e[41m"); end