Class: Ingenico::Connect::SDK::Marshaller
- Inherits:
-
Object
- Object
- Ingenico::Connect::SDK::Marshaller
- Defined in:
- lib/ingenico/connect/sdk/marshaller.rb
Overview
Class responsible for marshalling and unmarshalling objects to and from JSON
Direct Known Subclasses
Instance Method Summary collapse
-
#marshal(request_object) ⇒ Object
Marshals request_object to JSON format by calling #to_hash on it.
-
#unmarshal(response_json, type) ⇒ Object
Unmarshals a JSON string into an object of type type.
Instance Method Details
#marshal(request_object) ⇒ Object
Marshals request_object to JSON format by calling #to_hash on it.
7 8 9 |
# File 'lib/ingenico/connect/sdk/marshaller.rb', line 7 def marshal(request_object) raise NotImplementedError end |
#unmarshal(response_json, type) ⇒ Object
Unmarshals a JSON string into an object of type type. The new object is initialized by calling .new_from_hash with contents of the JSON as a Hash object.
- response_json
-
The JSON to unmarshal
- type
-
The class of the object that will be instantiated using type.new_from_hash
15 16 17 |
# File 'lib/ingenico/connect/sdk/marshaller.rb', line 15 def unmarshal(response_json, type) raise NotImplementedError end |