Class: String

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

Instance Method Summary collapse

Instance Method Details

#blueObject



26
27
28
# File 'lib/uc/ext/string.rb', line 26

def blue
  colorize(34)
end

#boldObject



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

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

#colorize(color_code) ⇒ Object



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

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

#greenObject



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

def green
  colorize(32)
end

#redObject



22
23
24
# File 'lib/uc/ext/string.rb', line 22

def red 
  colorize(31)
end

#whiteObject



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

def white
  colorize(37)
end

#yellowObject



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

def yellow
  colorize(33)
end