Class: String

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

Instance Method Summary collapse

Instance Method Details

#colorize(color_code) ⇒ Object



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

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

#fatalObject



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

def fatal
  red
end

#greenObject



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

def green
  colorize(32)
end

#redObject



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

def red
  colorize(31)
end

#yellowObject



60
61
62
# File 'lib/compute_unit/monkey_patches.rb', line 60

def yellow
  colorize(33)
end