Class: OnlinePayments::SDK::Domain::PersonalInformation
- Inherits:
-
OnlinePayments::SDK::DataObject
- Object
- OnlinePayments::SDK::DataObject
- OnlinePayments::SDK::Domain::PersonalInformation
- Defined in:
- lib/onlinepayments/sdk/domain/personal_information.rb
Instance Attribute Summary collapse
-
#date_of_birth ⇒ String
The current value of date_of_birth.
-
#gender ⇒ String
The current value of gender.
-
#name ⇒ OnlinePayments::SDK::Domain::PersonalName
The current value of name.
Instance Method Summary collapse
Methods inherited from OnlinePayments::SDK::DataObject
Instance Attribute Details
#date_of_birth ⇒ String
Returns 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 |
#gender ⇒ String
Returns the current value of gender.
13 14 15 |
# File 'lib/onlinepayments/sdk/domain/personal_information.rb', line 13 def gender @gender end |
#name ⇒ OnlinePayments::SDK::Domain::PersonalName
Returns the current value of name.
13 14 15 |
# File 'lib/onlinepayments/sdk/domain/personal_information.rb', line 13 def name @name end |
Instance Method Details
#from_hash(hash) ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/onlinepayments/sdk/domain/personal_information.rb', line 27 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 = OnlinePayments::SDK::Domain::PersonalName.new_from_hash(hash['name']) end end |
#to_h ⇒ Hash
19 20 21 22 23 24 25 |
# File 'lib/onlinepayments/sdk/domain/personal_information.rb', line 19 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 |