module AnsiSys::CSSFormatter

Public Class Methods

hash_to_styles(hash, separator = '; ') click to toggle source

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

# File lib/ansisys.rb, line 23
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

Private Instance Methods

hash_to_styles(hash, separator = '; ') click to toggle source

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

# File lib/ansisys.rb, line 23
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