Module: ShouldaAddons::Color

Defined in:
lib/shoulda_list_runner.rb

Constant Summary collapse

@@colors =
{ :clear => 0, :red => 31, :green => 32, :yellow => 33 }

Class Method Summary collapse

Class Method Details

.color(color) ⇒ Object



7
8
9
# File 'lib/shoulda_list_runner.rb', line 7

def self.color(color)
  "\e[#{@@colors[color.to_sym]}m"
end

.method_missing(color_name, *args) ⇒ Object



4
5
6
# File 'lib/shoulda_list_runner.rb', line 4

def self.method_missing(color_name, *args)
  color(color_name) + args.first + color(:clear) 
end