class Ingenico::Direct::SDK::Domain::PersonalInformation

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

Attributes

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

Public Instance Methods

from_hash(hash) click to toggle source
# 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_h() click to toggle source

@return (Hash)

Calls superclass method Ingenico::Direct::SDK::DataObject#to_h
# 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