class Ingenico::Connect::SDK::Domain::Payment::PersonalInformation

@attr [String] date_of_birth @attr [String] gender @attr [Ingenico::Connect::SDK::Domain::Payment::PersonalName] name

Attributes

date_of_birth[RW]
gender[RW]
name[RW]

Public Instance Methods

from_hash(hash) click to toggle source
# File lib/ingenico/connect/sdk/domain/payment/personal_information.rb, line 32
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? '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_h() click to toggle source

@return (Hash)

Calls superclass method Ingenico::Connect::SDK::DataObject#to_h
# File lib/ingenico/connect/sdk/domain/payment/personal_information.rb, line 24
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 unless @name.nil?
  hash
end