| Module | ActiveResource::Formats::XmlFormat |
| In: |
activeresource/lib/active_resource/formats/xml_format.rb
|
# File activeresource/lib/active_resource/formats/xml_format.rb, line 18 def decode(xml) from_xml_data(Hash.from_xml(xml)) end
# File activeresource/lib/active_resource/formats/xml_format.rb, line 14 def encode(hash) hash.to_xml end
# File activeresource/lib/active_resource/formats/xml_format.rb, line 10 def mime_type "application/xml" end
Manipulate from_xml Hash, because xml_simple is not exactly what we want for ActiveResource.
# File activeresource/lib/active_resource/formats/xml_format.rb, line 25 def from_xml_data(data) if data.is_a?(Hash) && data.keys.size == 1 data.values.first else data end end