class VantivLite::XML::Nokogiri::Serializer
Public Instance Methods
call(hash)
click to toggle source
# File lib/vantiv_lite/xml/nokogiri.rb, line 27 def call(hash) ::Nokogiri::XML::Document.new.tap { |d| add_xml_elements!(d, hash) }.to_s end
Private Instance Methods
attributes_or_elements!(parent, key, value)
click to toggle source
# File lib/vantiv_lite/xml/nokogiri.rb, line 33 def attributes_or_elements!(parent, key, value) return parent[key] = text_with(value) if attributes.include?(key) e = ::Nokogiri::XML::Element.new(key, parent) parent.add_child(e) add_xml_elements!(e, value) end
insert_text!(element, text)
click to toggle source
# File lib/vantiv_lite/xml/nokogiri.rb, line 40 def insert_text!(element, text) element.add_child(text_with(text)) end