Class: String

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

Overview

String is an override to the main String class that is used to colorize the output it is used to make the output more readable

Instance Method Summary collapse

Instance Method Details

#colorize(color_code) ⇒ Object



44
45
46
# File 'lib/trunk_spec_helper.rb', line 44

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

#greenObject



52
53
54
# File 'lib/trunk_spec_helper.rb', line 52

def green
  colorize(32)
end

#redObject



48
49
50
# File 'lib/trunk_spec_helper.rb', line 48

def red
  colorize(31)
end

#yellowObject



56
57
58
# File 'lib/trunk_spec_helper.rb', line 56

def yellow
  colorize(33)
end