Module: Wrest::Components::Translators::Json
- Defined in:
- lib/wrest/components/translators/json.rb
Class Method Summary collapse
- .deserialise(response, _options = {}) ⇒ Object
- .deserialize(response, options = {}) ⇒ Object
- .serialise(hash, options = {}) ⇒ Object
- .serialize(hash, options = {}) ⇒ Object
Class Method Details
.deserialise(response, _options = {}) ⇒ Object
18 19 20 |
# File 'lib/wrest/components/translators/json.rb', line 18 def deserialise(response, = {}) JSON.parse(response.body) end |
.deserialize(response, options = {}) ⇒ Object
22 23 24 |
# File 'lib/wrest/components/translators/json.rb', line 22 def deserialize(response, = {}) deserialise(response, ) end |
.serialise(hash, options = {}) ⇒ Object
26 27 28 |
# File 'lib/wrest/components/translators/json.rb', line 26 def serialise(hash, = {}) hash.to_json() end |
.serialize(hash, options = {}) ⇒ Object
30 31 32 |
# File 'lib/wrest/components/translators/json.rb', line 30 def serialize(hash, = {}) serialise(hash, ) end |