Class: String

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

Instance Method Summary collapse

Instance Method Details

#blueObject



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

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

#colorize(text, color_code) ⇒ Object



73
74
75
76
77
78
79
# File 'lib/helpers.rb', line 73

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

#dark_blueObject



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

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

#dark_greenObject



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

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

#greenObject



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

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

#purObject



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

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

#redObject



45
46
47
# File 'lib/helpers.rb', line 45

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

#yellowObject



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

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