Class: String

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

Class Method Summary collapse

Class Method Details

.color_set(style = :Terminal) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/colorize.rb', line 10

def self.color_set(style=:Terminal)
    style_name = style
    style = Colorize::Style.const_get(style)
    (style::COLORS).keys.each do |meth|
        class_eval %Q[
            def #{meth.to_s.downcase}
                ::Colorize::Style::#{style_name}.colorize(self, :#{meth})
            end
        ]
    end
end