Class: Ingenico::Connect::SDK::Domain::Mandates::MandateResponse

Inherits:
Ingenico::Connect::SDK::DataObject show all
Defined in:
lib/ingenico/connect/sdk/domain/mandates/mandate_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Connect::SDK::DataObject

new_from_hash

Instance Attribute Details

#aliasObject

String



15
16
17
# File 'lib/ingenico/connect/sdk/domain/mandates/mandate_response.rb', line 15

def alias
  @alias
end

#customerObject



18
19
20
# File 'lib/ingenico/connect/sdk/domain/mandates/mandate_response.rb', line 18

def customer
  @customer
end

#customer_referenceObject

String



21
22
23
# File 'lib/ingenico/connect/sdk/domain/mandates/mandate_response.rb', line 21

def customer_reference
  @customer_reference
end

#recurrence_typeObject

String



24
25
26
# File 'lib/ingenico/connect/sdk/domain/mandates/mandate_response.rb', line 24

def recurrence_type
  @recurrence_type
end

#statusObject

String



27
28
29
# File 'lib/ingenico/connect/sdk/domain/mandates/mandate_response.rb', line 27

def status
  @status
end

#unique_mandate_referenceObject

String



30
31
32
# File 'lib/ingenico/connect/sdk/domain/mandates/mandate_response.rb', line 30

def unique_mandate_reference
  @unique_mandate_reference
end

Instance Method Details

#from_hash(hash) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/ingenico/connect/sdk/domain/mandates/mandate_response.rb', line 43

def from_hash(hash)
  super
  if hash.has_key?('alias')
    @alias = hash['alias']
  end
  if hash.has_key?('customer')
    if !(hash['customer'].is_a? Hash)
      raise TypeError, "value '%s' is not a Hash" % [hash['customer']]
    end
    @customer = Ingenico::Connect::SDK::Domain::Mandates::MandateCustomer.new_from_hash(hash['customer'])
  end
  if hash.has_key?('customerReference')
    @customer_reference = hash['customerReference']
  end
  if hash.has_key?('recurrenceType')
    @recurrence_type = hash['recurrenceType']
  end
  if hash.has_key?('status')
    @status = hash['status']
  end
  if hash.has_key?('uniqueMandateReference')
    @unique_mandate_reference = hash['uniqueMandateReference']
  end
end

#to_hObject



32
33
34
35
36
37
38
39
40
41
# File 'lib/ingenico/connect/sdk/domain/mandates/mandate_response.rb', line 32

def to_h
  hash = super
  add_to_hash(hash, 'alias', @alias)
  add_to_hash(hash, 'customer', @customer)
  add_to_hash(hash, 'customerReference', @customer_reference)
  add_to_hash(hash, 'recurrenceType', @recurrence_type)
  add_to_hash(hash, 'status', @status)
  add_to_hash(hash, 'uniqueMandateReference', @unique_mandate_reference)
  hash
end