Class: Ingenico::Connect::SDK::Domain::Token::CustomerToken
- Inherits:
-
Definitions::CustomerBase
- Object
- Ingenico::Connect::SDK::DataObject
- Definitions::CustomerBase
- Ingenico::Connect::SDK::Domain::Token::CustomerToken
- Defined in:
- lib/ingenico/connect/sdk/domain/token/customer_token.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#billing_address ⇒ Ingenico::Connect::SDK::Domain::Definitions::Address
The current value of billing_address.
-
#personal_information ⇒ Ingenico::Connect::SDK::Domain::Token::PersonalInformationToken
The current value of personal_information.
Attributes inherited from Definitions::CustomerBase
#company_information, #merchant_customer_id, #vat_number
Instance Method Summary collapse
Methods inherited from Ingenico::Connect::SDK::DataObject
Instance Attribute Details
#billing_address ⇒ Ingenico::Connect::SDK::Domain::Definitions::Address
Returns the current value of billing_address.
15 16 17 |
# File 'lib/ingenico/connect/sdk/domain/token/customer_token.rb', line 15 def billing_address @billing_address end |
#personal_information ⇒ Ingenico::Connect::SDK::Domain::Token::PersonalInformationToken
Returns the current value of personal_information.
15 16 17 |
# File 'lib/ingenico/connect/sdk/domain/token/customer_token.rb', line 15 def personal_information @personal_information end |
Instance Method Details
#from_hash(hash) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/ingenico/connect/sdk/domain/token/customer_token.rb', line 29 def from_hash(hash) super if hash.has_key? 'billingAddress' raise TypeError, "value '%s' is not a Hash" % [hash['billingAddress']] unless hash['billingAddress'].is_a? Hash @billing_address = Ingenico::Connect::SDK::Domain::Definitions::Address.new_from_hash(hash['billingAddress']) end if hash.has_key? 'personalInformation' raise TypeError, "value '%s' is not a Hash" % [hash['personalInformation']] unless hash['personalInformation'].is_a? Hash @personal_information = Ingenico::Connect::SDK::Domain::Token::PersonalInformationToken.new_from_hash(hash['personalInformation']) end end |
#to_h ⇒ Hash
22 23 24 25 26 27 |
# File 'lib/ingenico/connect/sdk/domain/token/customer_token.rb', line 22 def to_h hash = super hash['billingAddress'] = @billing_address.to_h unless @billing_address.nil? hash['personalInformation'] = @personal_information.to_h unless @personal_information.nil? hash end |