Class: OnlinePayments::SDK::Domain::PersonalInformation

Inherits:
DataObject
  • Object
show all
Defined in:
lib/onlinepayments/sdk/domain/personal_information.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from 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



13
14
15
# File 'lib/onlinepayments/sdk/domain/personal_information.rb', line 13

def date_of_birth
  @date_of_birth
end

#genderString

Returns the current value of gender.

Returns:

  • (String)

    the current value of gender



13
14
15
# File 'lib/onlinepayments/sdk/domain/personal_information.rb', line 13

def gender
  @gender
end

#nameOnlinePayments::SDK::Domain::PersonalName

Returns the current value of name.

Returns:



13
14
15
# File 'lib/onlinepayments/sdk/domain/personal_information.rb', line 13

def name
  @name
end

Instance Method Details

#from_hash(hash) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/onlinepayments/sdk/domain/personal_information.rb', line 30

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 = OnlinePayments::SDK::Domain::PersonalName.new_from_hash(hash['name'])
  end
end

#to_hHash

Returns:

  • (Hash)


22
23
24
25
26
27
28
# File 'lib/onlinepayments/sdk/domain/personal_information.rb', line 22

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