Module: Pantheios::Services::Common::Console::Internal_::ColourInitialiser

Included in:
AnsiEscapeSequences::Background, AnsiEscapeSequences::Foreground
Defined in:
lib/pantheios/services/common/console.rb

Class Method Summary collapse

Class Method Details

.extended(other) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# 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