class Ingenico::Connect::SDK::Marshaller

Class responsible for marshalling and unmarshalling objects to and from JSON

Public Instance Methods

marshal(request_object) click to toggle source

Marshals request_object to JSON format by calling to_h on it.

@param request_object [Ingenico::Connect::SDK::DataObject] the object to format @return [String] request_object converted to JSON

# File lib/ingenico/connect/sdk/marshaller.rb, line 10
def marshal(request_object)
  raise NotImplementedError
end
unmarshal(response_json, type) click to toggle source

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.

@param response_json [String] The JSON to unmarshal @param type [Type] The class of the object that will be instantiated using type.new_from_hash @return The JSON unmarshalled to the given type

# File lib/ingenico/connect/sdk/marshaller.rb, line 20
def unmarshal(response_json, type)
  raise NotImplementedError
end