Class: String

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

Instance Method Summary collapse

Instance Method Details

#blueObject



32
33
34
# File 'lib/techbook.rb', line 32

def blue
  colorize(34)
end

#colorize(color_code) ⇒ Object

colorization



16
17
18
# File 'lib/techbook.rb', line 16

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

#greenObject



24
25
26
# File 'lib/techbook.rb', line 24

def green
  colorize(32)
end

#light_blueObject



40
41
42
# File 'lib/techbook.rb', line 40

def light_blue
  colorize(36)
end

#pinkObject



36
37
38
# File 'lib/techbook.rb', line 36

def pink
  colorize(35)
end

#redObject



20
21
22
# File 'lib/techbook.rb', line 20

def red
  colorize(31)
end

#yellowObject



28
29
30
# File 'lib/techbook.rb', line 28

def yellow
  colorize(33)
end