class TINCheck::XML::Ox::Serializer

Public Instance Methods

call(hash) click to toggle source
# File lib/tincheck/xml/ox.rb, line 27
def call(hash)
  ::Ox.dump(add_xml_elements!(::Ox::Document.new(version: '1.0'), hash))
end

Private Instance Methods

attributes_or_elements!(parent, key, value) click to toggle source
# File lib/tincheck/xml/ox.rb, line 33
def attributes_or_elements!(parent, key, value)
  return parent[key] = text_with(value) if attributes.include?(key)
  e = ::Ox::Element.new(key)
  parent << e
  add_xml_elements!(e, value)
end
insert_text!(node, text) click to toggle source
# File lib/tincheck/xml/ox.rb, line 40
def insert_text!(node, text)
  node << text_with(text)
end