Class: OnlinePayments::SDK::Marshaller
- Inherits:
-
Object
- Object
- OnlinePayments::SDK::Marshaller
- Defined in:
- lib/onlinepayments/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) ⇒ String
Marshals request_object to JSON format by calling #to_h on it.
-
#unmarshal(response_json, type) ⇒ Object
Unmarshals a JSON string into an object of type type.
Instance Method Details
#marshal(request_object) ⇒ String
Marshals request_object to JSON format by calling #to_h on it.
10 11 12 |
# File 'lib/onlinepayments/sdk/marshaller.rb', line 10 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.
20 21 22 |
# File 'lib/onlinepayments/sdk/marshaller.rb', line 20 def unmarshal(response_json, type) raise NotImplementedError end |