class TINCheck::XML::REXML::Serializer

Public Instance Methods

call(hash) click to toggle source
# File lib/tincheck/xml/rexml.rb, line 32
def call(hash)
  ::REXML::Document.new(nil, attribute_quote: :quote).tap do |d|
    d.add(::REXML::XMLDecl.new)
    add_xml_elements!(d, hash)
  end.to_s
end

Private Instance Methods

attributes_or_elements!(parent, key, value) click to toggle source
# File lib/tincheck/xml/rexml.rb, line 41
def attributes_or_elements!(parent, key, value)
  return parent.add_attribute(key, text_with(value)) if attributes.include?(key)
  add_xml_elements!(::REXML::Element.new(key, parent, parent.context), value)
end
insert_text!(element, text) click to toggle source
# File lib/tincheck/xml/rexml.rb, line 46
def insert_text!(element, text)
  element.add_text(text_with(text))
end