Class: HasDomAttrs::DomStyle

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/has_dom_attrs.rb

Instance Method Summary collapse

Instance Method Details

#merge(other) ⇒ Object



127
128
129
# File 'lib/has_dom_attrs.rb', line 127

def merge(other)
  DomStyle.new(__getobj__.merge(other))
end

#to_sObject



131
132
133
134
135
# File 'lib/has_dom_attrs.rb', line 131

def to_s
  __getobj__.reject { |_, value| value.nil? }
            .map { |key, value| "#{key.to_s.dasherize}: #{value};" }
            .join(" ")
end