Module: Wrest::Components::Translators::Xml
Instance Method Summary collapse
- #deserialise(response, options = {}) ⇒ Object
- #deserialize(response, options = {}) ⇒ Object
- #serialise(hash, options = {}) ⇒ Object
- #serialize(hash, options = {}) ⇒ Object
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,={}) if(![:xpath].nil?) ActiveSupport::XmlMini.filter(response.body,[:xpath]) else Hash.from_xml(response.body) end end |
#deserialize(response, options = {}) ⇒ Object
22 23 24 |
# File 'lib/wrest/components/translators/xml.rb', line 22 def deserialize(response, = {}) deserialise(response, ) end |
#serialise(hash, options = {}) ⇒ Object
26 27 28 |
# File 'lib/wrest/components/translators/xml.rb', line 26 def serialise(hash, = {}) hash.to_xml() end |
#serialize(hash, options = {}) ⇒ Object
30 31 32 |
# File 'lib/wrest/components/translators/xml.rb', line 30 def serialize(hash, = {}) serialise(hash, ) end |