Class: Ingenico::Connect::SDK::Domain::Payment::PersonalInformation
- Inherits:
-
Ingenico::Connect::SDK::DataObject
- Object
- Ingenico::Connect::SDK::DataObject
- Ingenico::Connect::SDK::Domain::Payment::PersonalInformation
- Defined in:
- lib/ingenico/connect/sdk/domain/payment/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 ⇒ Ingenico::Connect::SDK::Domain::Payment::PersonalName
The current value of name.
Instance Method Summary collapse
Methods inherited from Ingenico::Connect::SDK::DataObject
Instance Attribute Details
#date_of_birth ⇒ String
Returns the current value of date_of_birth.
15 16 17 |
# File 'lib/ingenico/connect/sdk/domain/payment/personal_information.rb', line 15 def date_of_birth @date_of_birth end |
#gender ⇒ String
Returns the current value of gender.
15 16 17 |
# File 'lib/ingenico/connect/sdk/domain/payment/personal_information.rb', line 15 def gender @gender end |
#name ⇒ Ingenico::Connect::SDK::Domain::Payment::PersonalName
Returns the current value of name.
15 16 17 |
# File 'lib/ingenico/connect/sdk/domain/payment/personal_information.rb', line 15 def name @name end |
Instance Method Details
#from_hash(hash) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 |
# 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 ⇒ Hash
24 25 26 27 28 29 30 |
# 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 |