Module: MyData::XmlParser

Extended by:
XmlParser
Included in:
XmlParser
Defined in:
lib/my_data/xml_parser.rb

Instance Method Summary collapse

Instance Method Details

#xml_to_resource(xml:, resource:, root: nil) ⇒ Object



6
7
8
9
10
11
# File 'lib/my_data/xml_parser.rb', line 6

def xml_to_resource(xml:, resource:, root: nil)
  h = transofrm_xml_to_hash(fix_xml(xml))
  h = h[root] if root

  resource.new hash_mapping(h, resource)
end