Class: String

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

Instance Method Summary collapse

Instance Method Details

#blueObject



66
67
68
# File 'lib/helpers.rb', line 66

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

#colorize(text, color_code) ⇒ Object



78
79
80
81
82
83
84
# File 'lib/helpers.rb', line 78

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

#dark_blueObject



70
71
72
# File 'lib/helpers.rb', line 70

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

#dark_greenObject



58
59
60
# File 'lib/helpers.rb', line 58

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

#greenObject



54
55
56
# File 'lib/helpers.rb', line 54

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

#purObject



74
75
76
# File 'lib/helpers.rb', line 74

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

#redObject



50
51
52
# File 'lib/helpers.rb', line 50

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

#yellowObject



62
63
64
# File 'lib/helpers.rb', line 62

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