Class: Ingenico::Connect::SDK::Domain::Product::AccountOnFile
- Inherits:
-
Ingenico::Connect::SDK::DataObject
- Object
- Ingenico::Connect::SDK::DataObject
- Ingenico::Connect::SDK::Domain::Product::AccountOnFile
- Defined in:
- lib/ingenico/connect/sdk/domain/product/account_on_file.rb
Overview
Class AccountOnFile
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Array of AccountOnFileAttribute.
- #display_hints ⇒ Object
-
#id ⇒ Object
Integer.
-
#payment_product_id ⇒ Object
Integer.
Instance Method Summary collapse
Methods inherited from Ingenico::Connect::SDK::DataObject
Instance Attribute Details
#attributes ⇒ Object
17 18 19 |
# File 'lib/ingenico/connect/sdk/domain/product/account_on_file.rb', line 17 def attributes @attributes end |
#display_hints ⇒ Object
20 21 22 |
# File 'lib/ingenico/connect/sdk/domain/product/account_on_file.rb', line 20 def display_hints @display_hints end |
#id ⇒ Object
Integer
23 24 25 |
# File 'lib/ingenico/connect/sdk/domain/product/account_on_file.rb', line 23 def id @id end |
#payment_product_id ⇒ Object
Integer
26 27 28 |
# File 'lib/ingenico/connect/sdk/domain/product/account_on_file.rb', line 26 def payment_product_id @payment_product_id end |
Instance Method Details
#from_hash(hash) ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/ingenico/connect/sdk/domain/product/account_on_file.rb', line 37 def from_hash(hash) super if hash.has_key?('attributes') if !(hash['attributes'].is_a? Array) raise TypeError, "value '%s' is not an Array" % [hash['attributes']] end @attributes = [] hash['attributes'].each do |e| @attributes << Ingenico::Connect::SDK::Domain::Product::AccountOnFileAttribute.new_from_hash(e) end end if hash.has_key?('displayHints') if !(hash['displayHints'].is_a? Hash) raise TypeError, "value '%s' is not a Hash" % [hash['displayHints']] end @display_hints = Ingenico::Connect::SDK::Domain::Product::AccountOnFileDisplayHints.new_from_hash(hash['displayHints']) end if hash.has_key?('id') @id = hash['id'] end if hash.has_key?('paymentProductId') @payment_product_id = hash['paymentProductId'] end end |
#to_h ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/ingenico/connect/sdk/domain/product/account_on_file.rb', line 28 def to_h hash = super add_to_hash(hash, 'attributes', @attributes) add_to_hash(hash, 'displayHints', @display_hints) add_to_hash(hash, 'id', @id) add_to_hash(hash, 'paymentProductId', @payment_product_id) hash end |