Class: Worldline::Connect::SDK::JSON::Marshaller

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

Overview

Class responsible for marshalling and unmarshalling objects to and from JSON

Direct Known Subclasses

DefaultMarshaller

Instance Method Summary collapse

Instance Method Details

#marshal(request_object) ⇒ String

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

Raises:

  • (NotImplementedError)


12
13
14
# File 'lib/worldline/connect/sdk/json/marshaller.rb', line 12

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.

Raises:

  • (NotImplementedError)


22
23
24
# File 'lib/worldline/connect/sdk/json/marshaller.rb', line 22

def unmarshal(response_json, type)
  raise NotImplementedError
end