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