Class: Ingenico::Connect::SDK::Marshaller

Inherits:
Object
  • Object
show all
Defined in:
lib/ingenico/connect/sdk/marshaller.rb

Overview

Class responsible for marshalling and unmarshalling objects to and from JSON

Direct Known Subclasses

DefaultImpl::DefaultMarshaller

Instance Method Summary collapse

Instance Method Details

#marshal(request_object) ⇒ Object

Marshals request_object to JSON format by calling #to_hash on it.

Raises:

  • (NotImplementedError)


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

Raises:

  • (NotImplementedError)


15
16
17
# File 'lib/ingenico/connect/sdk/marshaller.rb', line 15

def unmarshal(response_json, type)
  raise NotImplementedError
end