Class: Ingenico::Connect::SDK::Domain::Token::TokenNonSepaDirectDebit
- Inherits:
-
AbstractToken
- Object
- Ingenico::Connect::SDK::DataObject
- AbstractToken
- Ingenico::Connect::SDK::Domain::Token::TokenNonSepaDirectDebit
- Defined in:
- lib/ingenico/connect/sdk/domain/token/token_non_sepa_direct_debit.rb
Instance Attribute Summary collapse
-
#customer ⇒ Ingenico::Connect::SDK::Domain::Token::CustomerToken
The current value of customer.
-
#mandate ⇒ Ingenico::Connect::SDK::Domain::Token::MandateNonSepaDirectDebit
The current value of mandate.
Attributes inherited from AbstractToken
Instance Method Summary collapse
Methods inherited from Ingenico::Connect::SDK::DataObject
Instance Attribute Details
#customer ⇒ Ingenico::Connect::SDK::Domain::Token::CustomerToken
Returns the current value of customer.
15 16 17 |
# File 'lib/ingenico/connect/sdk/domain/token/token_non_sepa_direct_debit.rb', line 15 def customer @customer end |
#mandate ⇒ Ingenico::Connect::SDK::Domain::Token::MandateNonSepaDirectDebit
Returns the current value of mandate.
15 16 17 |
# File 'lib/ingenico/connect/sdk/domain/token/token_non_sepa_direct_debit.rb', line 15 def mandate @mandate 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/token_non_sepa_direct_debit.rb', line 29 def from_hash(hash) super if hash.has_key? 'customer' raise TypeError, "value '%s' is not a Hash" % [hash['customer']] unless hash['customer'].is_a? Hash @customer = Ingenico::Connect::SDK::Domain::Token::CustomerToken.new_from_hash(hash['customer']) end if hash.has_key? 'mandate' raise TypeError, "value '%s' is not a Hash" % [hash['mandate']] unless hash['mandate'].is_a? Hash @mandate = Ingenico::Connect::SDK::Domain::Token::MandateNonSepaDirectDebit.new_from_hash(hash['mandate']) end end |
#to_h ⇒ Hash
22 23 24 25 26 27 |
# File 'lib/ingenico/connect/sdk/domain/token/token_non_sepa_direct_debit.rb', line 22 def to_h hash = super hash['customer'] = @customer.to_h unless @customer.nil? hash['mandate'] = @mandate.to_h unless @mandate.nil? hash end |