Class: Ingenico::Direct::SDK::Domain::PersonalInformation

Inherits:
Ingenico::Direct::SDK::DataObject show all
Defined in:
lib/ingenico/direct/sdk/domain/personal_information.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Direct::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



14
15
16
# File 'lib/ingenico/direct/sdk/domain/personal_information.rb', line 14

def date_of_birth
  @date_of_birth
end

#genderString

Returns the current value of gender.

Returns:

  • (String)

    the current value of gender



14
15
16
# File 'lib/ingenico/direct/sdk/domain/personal_information.rb', line 14

def gender
  @gender
end

#nameIngenico::Direct::SDK::Domain::PersonalName

Returns the current value of name.

Returns:



14
15
16
# File 'lib/ingenico/direct/sdk/domain/personal_information.rb', line 14

def name
  @name
end

Instance Method Details

#from_hash(hash) ⇒ Object



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

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

#to_hHash

Returns:

  • (Hash)


20
21
22
23
24
25
26
# File 'lib/ingenico/direct/sdk/domain/personal_information.rb', line 20

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