Class: String

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

Overview

Adding Console Colors

Instance Method Summary collapse

Instance Method Details

#blackObject



3
4
5
# File 'lib/coloring.rb', line 3

def black
  "\e[30m#{self}\e[0m"
end

#blueObject



15
16
17
# File 'lib/coloring.rb', line 15

def blue
  "\e[34m#{self}\e[0m"
end

#boldObject



35
36
37
# File 'lib/coloring.rb', line 35

def bold
  "\e[1m#{self}\e[22m"
end

#cyanObject



23
24
25
# File 'lib/coloring.rb', line 23

def cyan
  "\e[36m#{self}\e[0m"
end

#grayObject



27
28
29
# File 'lib/coloring.rb', line 27

def gray
  "\e[37m#{self}\e[0m"
end

#greenObject



11
12
13
# File 'lib/coloring.rb', line 11

def green
  "\e[32m#{self}\e[0m"
end

#magentaObject



19
20
21
# File 'lib/coloring.rb', line 19

def magenta
  "\e[35m#{self}\e[0m"
end

#redObject



7
8
9
# File 'lib/coloring.rb', line 7

def red
  "\e[31m#{self}\e[0m"
end

#yellowObject



31
32
33
# File 'lib/coloring.rb', line 31

def yellow
  "\e[33m#{self}\e[0m"
end