Class: Nestful::Formats::XmlFormat

Inherits:
Format
  • Object
show all
Defined in:
lib/nestful/formats/xml_format.rb

Instance Method Summary collapse

Instance Method Details

#decode(xml) ⇒ Object



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

def decode(xml)
  from_xml_data(Hash.from_xml(xml))
end

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



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

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

#extensionObject



6
7
8
# File 'lib/nestful/formats/xml_format.rb', line 6

def extension
  'xml'
end

#mime_typeObject



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

def mime_type
  'application/xml'
end