Class: String

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

Instance Method Summary collapse

Instance Method Details

#colorize(color_code) ⇒ Object



2
3
4
# File 'lib/gripst/string.rb', line 2

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

#greenObject



10
11
12
# File 'lib/gripst/string.rb', line 10

def green
  colorize(32)
end

#pinkObject



18
19
20
# File 'lib/gripst/string.rb', line 18

def pink
  colorize(35)
end

#redObject



6
7
8
# File 'lib/gripst/string.rb', line 6

def red
  colorize(31)
end

#yellowObject



14
15
16
# File 'lib/gripst/string.rb', line 14

def yellow
  colorize(33)
end