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



42
43
44
# File 'lib/trunk_spec_helper.rb', line 42

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

#greenObject



50
51
52
# File 'lib/trunk_spec_helper.rb', line 50

def green
  colorize(32)
end

#redObject



46
47
48
# File 'lib/trunk_spec_helper.rb', line 46

def red
  colorize(31)
end

#yellowObject



54
55
56
# File 'lib/trunk_spec_helper.rb', line 54

def yellow
  colorize(33)
end