Module: OverridesTracker::StringColorizer

Defined in:
lib/overrides_tracker/string_colorizer.rb

Instance Method Summary collapse

Instance Method Details

#blueObject



18
19
20
# File 'lib/overrides_tracker/string_colorizer.rb', line 18

def blue
  colorize(34)
end

#boldObject



30
31
32
# File 'lib/overrides_tracker/string_colorizer.rb', line 30

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

#colorize(color_code) ⇒ Object



2
3
4
# File 'lib/overrides_tracker/string_colorizer.rb', line 2

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

#greenObject



10
11
12
# File 'lib/overrides_tracker/string_colorizer.rb', line 10

def green
  colorize(32)
end

#italicObject



34
35
36
# File 'lib/overrides_tracker/string_colorizer.rb', line 34

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

#light_blueObject



26
27
28
# File 'lib/overrides_tracker/string_colorizer.rb', line 26

def light_blue
  colorize(36)
end

#pinkObject



22
23
24
# File 'lib/overrides_tracker/string_colorizer.rb', line 22

def pink
  colorize(35)
end

#redObject



6
7
8
# File 'lib/overrides_tracker/string_colorizer.rb', line 6

def red
  colorize(31)
end

#yellowObject



14
15
16
# File 'lib/overrides_tracker/string_colorizer.rb', line 14

def yellow
  colorize(33)
end