module Pantheios::Services::Common::Console::Internal_::ColourInitialiser

Public Class Methods

extended(other) click to toggle source
# File lib/pantheios/services/common/console.rb, line 24
def self.extended other

        other::COLOURS.each do |name, value|

                other.const_set(name.to_s.upcase, value)

                if SHOULD_COLOURIZE_

                        other.define_singleton_method(name) { |s| "\x1B[#{value}m#{s}\x1B[0m" }
                else

                        other.define_singleton_method(name) { |s| s }
                end
        end
end