module Helpers::Colorize
Public Class Methods
colorize(color, text)
click to toggle source
# File lib/helpers/colorize.rb, line 25 def colorize(color, text) color = Colorize::Colors.const_get(color.to_s.upcase) color ? colorful_text(color, text) : text rescue # puts color # puts $? text end
method_missing(symbol, *args)
click to toggle source
Calls superclass method
# File lib/helpers/colorize.rb, line 34 def method_missing(symbol, *args) color = Colorize::Colors.const_get(color.to_s.upcase) return colorful_text(color, *args) if color super rescue super # puts symbol # puts $? # args end
Private Class Methods
colorful_text(color, text)
click to toggle source
# File lib/helpers/colorize.rb, line 47 def colorful_text(color, text) "\e[#{color}m#{text}\e[0;0m" end