Module: Color

Defined in:
lib/redgreen.rb

Overview

cute.

Constant Summary collapse

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

Class Method Summary collapse

Class Method Details

.color(color) ⇒ Object



10
11
12
# File 'lib/redgreen.rb', line 10

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

.method_missing(color_name, *args) ⇒ Object



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

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