Class: CXML::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/cxml/parser.rb

Instance Method Summary collapse

Instance Method Details

#parse(data) ⇒ Object



8
9
10
11
12
13
# File 'lib/cxml/parser.rb', line 8

def parse(data)
  hash = XmlSimple.xml_in(data, { 'ForceArray' => false })
  hash.transform_keys!(&method(:underscore_key))
  hash.transform_values!(&method(:underscore_hash_values))
  hash
end