class Ingenico::Direct::SDK::DataObject

Base class for all SDK data objects, supports marshalling and unmarshalling the data object to and from JSON.

Public Class Methods

new_from_hash(hash) click to toggle source

Create a new instance of this object (DataObject or descendant) from a hash containing attribute values in camelCase. Note that the hash contains Strings as keys instead of more commonly used tokens.

# File lib/ingenico/direct/sdk/data_object.rb, line 20
def self.new_from_hash(hash)
  obj = self.new
  obj.from_hash(hash)
  obj
end

Public Instance Methods

from_hash(hash) click to toggle source

Set attributes from values in parameter hash. Should be overridden by descendants in order to properly restore their attributes from the hash. Note that the hash contains Strings as keys instead of more commonly used tokens.

# File lib/ingenico/direct/sdk/data_object.rb, line 29
def from_hash(hash)
end
to_h() click to toggle source

Returns a hash representation of the DataObject. The hash contains camelCase representations of the variables, and their values. Should be overridden to add all instance variables of the object.

@return [Hash]

# File lib/ingenico/direct/sdk/data_object.rb, line 13
def to_h
  {}
end