Method: Jig::CSS#to_declarations

Defined in:
lib/jig/css.rb

#to_declarations(hash) ⇒ Object



80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/jig/css.rb', line 80

def to_declarations(hash)
  return nil unless hash
  hash.inject(Jig.null) do |djig, (property, value)| 
    djig.push(
      case value
        when Gap
          value
        when Symbol
          Gap.new(value) { |fill| declaration(property, fill) }
        else
          declaration(property, value)
      end
    )
  end
end