Class: String

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

Instance Method Summary collapse

Instance Method Details

#blackObject



4
5
6
# File 'lib/core_extensions/string.rb', line 4

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


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

def blink
  "\e[5m#{self}\e[25m"
end

#boldObject



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

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

#cyanObject



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

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

#greenObject



12
13
14
# File 'lib/core_extensions/string.rb', line 12

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

#italicObject



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

def italic
  "\e[3m#{self}\e[23m"
end

#no_colorsObject



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

def no_colors
  gsub(/\e\[\d+m/, '')
end

#redObject



8
9
10
# File 'lib/core_extensions/string.rb', line 8

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