Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/pp-stats/format.rb

Instance Method Summary collapse

Instance Method Details

#blueObject



53
54
55
# File 'lib/pp-stats/format.rb', line 53

def blue
  colorize(34)
end

#colorize(color_code) ⇒ Object



37
38
39
# File 'lib/pp-stats/format.rb', line 37

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

#cyanObject



61
62
63
# File 'lib/pp-stats/format.rb', line 61

def cyan
  colorize(36)
end

#grayObject



65
66
67
# File 'lib/pp-stats/format.rb', line 65

def gray
  colorize(37)
end

#greenObject



45
46
47
# File 'lib/pp-stats/format.rb', line 45

def green
  colorize(32)
end

#magentaObject



57
58
59
# File 'lib/pp-stats/format.rb', line 57

def magenta
  colorize(35)
end

#redObject



41
42
43
# File 'lib/pp-stats/format.rb', line 41

def red
  colorize(31)
end

#yellowObject



49
50
51
# File 'lib/pp-stats/format.rb', line 49

def yellow
  colorize(33)
end