Class: Ingenico::Connect::SDK::Domain::Payment::PersonalInformation

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

new_from_hash

Instance Attribute Details

#date_of_birthString

Returns the current value of date_of_birth.

Returns:

  • (String)

    the current value of date_of_birth



17
18
19
# File 'lib/ingenico/connect/sdk/domain/payment/personal_information.rb', line 17

def date_of_birth
  @date_of_birth
end

#genderString

Returns the current value of gender.

Returns:

  • (String)

    the current value of gender



17
18
19
# File 'lib/ingenico/connect/sdk/domain/payment/personal_information.rb', line 17

def gender
  @gender
end

#identificationIngenico::Connect::SDK::Domain::Payment::PersonalIdentification

Returns the current value of identification.

Returns:



17
18
19
# File 'lib/ingenico/connect/sdk/domain/payment/personal_information.rb', line 17

def identification
  @identification
end

#nameIngenico::Connect::SDK::Domain::Payment::PersonalName

Returns the current value of name.

Returns:



17
18
19
# File 'lib/ingenico/connect/sdk/domain/payment/personal_information.rb', line 17

def name
  @name
end

Instance Method Details

#from_hash(hash) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/ingenico/connect/sdk/domain/payment/personal_information.rb', line 37

def from_hash(hash)
  super
  if hash.has_key? 'dateOfBirth'
    @date_of_birth = hash['dateOfBirth']
  end
  if hash.has_key? 'gender'
    @gender = hash['gender']
  end
  if hash.has_key? 'identification'
    raise TypeError, "value '%s' is not a Hash" % [hash['identification']] unless hash['identification'].is_a? Hash
    @identification = Ingenico::Connect::SDK::Domain::Payment::PersonalIdentification.new_from_hash(hash['identification'])
  end
  if hash.has_key? 'name'
    raise TypeError, "value '%s' is not a Hash" % [hash['name']] unless hash['name'].is_a? Hash
    @name = Ingenico::Connect::SDK::Domain::Payment::PersonalName.new_from_hash(hash['name'])
  end
end

#to_hHash

Returns:

  • (Hash)


28
29
30
31
32
33
34
35
# File 'lib/ingenico/connect/sdk/domain/payment/personal_information.rb', line 28

def to_h
  hash = super
  hash['dateOfBirth'] = @date_of_birth unless @date_of_birth.nil?
  hash['gender'] = @gender unless @gender.nil?
  hash['identification'] = @identification.to_h unless @identification.nil?
  hash['name'] = @name.to_h unless @name.nil?
  hash
end