Module: AnsiSys::CSSFormatter

Included in:
SGR
Defined in:
lib/ansisys.rb

Class Method Summary collapse

Class Method Details

.hash_to_styles(hash, separator = '; ') ⇒ Object

make a CSS style-let from a Hash of CSS settings



22
23
24
25
26
27
28
# File 'lib/ansisys.rb', line 22

def hash_to_styles(hash, separator = '; ')
	unless hash.empty?
		return hash.map{|e| "#{e[0]}: #{e[1].join(' ')}"}.join(separator)
	else
		return nil
	end
end