Class: String

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

Instance Method Summary collapse

Instance Method Details

#blueObject



6
# File 'lib/ext/string_ext.rb', line 6

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

#colorize(text, color_code) ⇒ Object



9
# File 'lib/ext/string_ext.rb', line 9

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

#dark_blueObject



7
# File 'lib/ext/string_ext.rb', line 7

def dark_blue; colorize(self, "\e[34m"); end

#dark_greenObject



4
# File 'lib/ext/string_ext.rb', line 4

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

#greenObject



3
# File 'lib/ext/string_ext.rb', line 3

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

#purObject



8
# File 'lib/ext/string_ext.rb', line 8

def pur; colorize(self, "\e[1m\e[35m"); end

#redObject



2
# File 'lib/ext/string_ext.rb', line 2

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

#yellowObject



5
# File 'lib/ext/string_ext.rb', line 5

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