Files

ActiveResource::Formats::XmlFormat

Public Instance Methods

decode(xml) click to toggle source
    # File lib/active_resource/formats/xml_format.rb, line 20
20:       def decode(xml)
21:         from_xml_data(Hash.from_xml(xml))
22:       end
encode(hash, options={}) click to toggle source
    # File lib/active_resource/formats/xml_format.rb, line 16
16:       def encode(hash, options={})
17:         hash.to_xml(options)
18:       end
extension() click to toggle source
    # File lib/active_resource/formats/xml_format.rb, line 8
 8:       def extension
 9:         "xml"
10:       end
mime_type() click to toggle source
    # File lib/active_resource/formats/xml_format.rb, line 12
12:       def mime_type
13:         "application/xml"
14:       end

Private Instance Methods

from_xml_data(data) click to toggle source

Manipulate from_xml Hash, because xml_simple is not exactly what we want for Active Resource.

    # File lib/active_resource/formats/xml_format.rb, line 27
27:         def from_xml_data(data)
28:           if data.is_a?(Hash) && data.keys.size == 1
29:             data.values.first
30:           else
31:             data
32:           end
33:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.