Module: Wrest::Components::Translators::Json
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
16 17 18 |
# File 'lib/wrest/components/translators/json.rb', line 16 def deserialise(response, = {}) ActiveSupport::JSON.decode(response.body) end |
#deserialize(response, options = {}) ⇒ Object
20 21 22 |
# File 'lib/wrest/components/translators/json.rb', line 20 def deserialize(response, = {}) deserialise(response, ) end |
#serialise(hash, options = {}) ⇒ Object
24 25 26 |
# File 'lib/wrest/components/translators/json.rb', line 24 def serialise(hash, = {}) hash.to_json() end |
#serialize(hash, options = {}) ⇒ Object
28 29 30 |
# File 'lib/wrest/components/translators/json.rb', line 28 def serialize(hash, = {}) serialise(hash, ) end |