Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/ruar/core_ext/string_colorize.rb

Instance Method Summary collapse

Instance Method Details

#blueObject



20
21
22
# File 'lib/ruar/core_ext/string_colorize.rb', line 20

def blue
  colorize(34)
end

#colorize(color_code) ⇒ Object



4
5
6
# File 'lib/ruar/core_ext/string_colorize.rb', line 4

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

#greenObject



12
13
14
# File 'lib/ruar/core_ext/string_colorize.rb', line 12

def green
  colorize(32)
end

#redObject



8
9
10
# File 'lib/ruar/core_ext/string_colorize.rb', line 8

def red
  colorize(31)
end

#yellowObject



16
17
18
# File 'lib/ruar/core_ext/string_colorize.rb', line 16

def yellow
  colorize(33)
end