Module: ActiveResource::Formats::XmlFormat

Extended by:
XmlFormat
Included in:
XmlFormat
Defined in:
lib/active_resource/formats/xml_format.rb

Instance Method Summary collapse

Instance Method Details

#decode(xml) ⇒ Object



22
23
24
# File 'lib/active_resource/formats/xml_format.rb', line 22

def decode(xml)
  Formats.remove_root(Hash.from_xml(xml))
end

#encode(hash, options = {}) ⇒ Object



18
19
20
# File 'lib/active_resource/formats/xml_format.rb', line 18

def encode(hash, options = {})
  hash.to_xml(options)
end

#extensionObject



10
11
12
# File 'lib/active_resource/formats/xml_format.rb', line 10

def extension
  "xml"
end

#mime_typeObject



14
15
16
# File 'lib/active_resource/formats/xml_format.rb', line 14

def mime_type
  "application/xml"
end