Module: Wrest::Components::Translators::Xml

Extended by:
Xml
Included in:
Xml
Defined in:
lib/wrest/components/translators/xml.rb

Instance Method Summary collapse

Instance Method Details

#deserialise(response, options = {}) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/wrest/components/translators/xml.rb', line 14

def deserialise(response,options={})
  if(!options[:xpath].nil?)
    ActiveSupport::XmlMini.filter(response.body,options[:xpath])
  else
    Hash.from_xml(response.body)
  end
end

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



22
23
24
# File 'lib/wrest/components/translators/xml.rb', line 22

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