Class: Ingenico::Connect::SDK::Domain::Product::PaymentProductGroup
- Inherits:
-
Ingenico::Connect::SDK::DataObject
- Object
- Ingenico::Connect::SDK::DataObject
- Ingenico::Connect::SDK::Domain::Product::PaymentProductGroup
- Defined in:
- lib/ingenico/connect/sdk/domain/product/payment_product_group.rb
Overview
Class PaymentProductGroup
Direct Known Subclasses
Instance Attribute Summary collapse
-
#accounts_on_file ⇒ Object
Array of AccountOnFile.
- #display_hints ⇒ Object
-
#fields ⇒ Object
Array of PaymentProductField.
-
#id ⇒ Object
String.
Instance Method Summary collapse
Methods inherited from Ingenico::Connect::SDK::DataObject
Instance Attribute Details
#accounts_on_file ⇒ Object
Array of AccountOnFile
18 19 20 |
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_group.rb', line 18 def accounts_on_file @accounts_on_file end |
#display_hints ⇒ Object
21 22 23 |
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_group.rb', line 21 def display_hints @display_hints end |
#fields ⇒ Object
24 25 26 |
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_group.rb', line 24 def fields @fields end |
#id ⇒ Object
String
27 28 29 |
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_group.rb', line 27 def id @id end |
Instance Method Details
#from_hash(hash) ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_group.rb', line 38 def from_hash(hash) super if hash.has_key?('accountsOnFile') if !(hash['accountsOnFile'].is_a? Array) raise TypeError, "value '%s' is not an Array" % [hash['accountsOnFile']] end @accounts_on_file = [] hash['accountsOnFile'].each do |e| @accounts_on_file << Ingenico::Connect::SDK::Domain::Product::AccountOnFile.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::PaymentProductDisplayHints.new_from_hash(hash['displayHints']) end if hash.has_key?('fields') if !(hash['fields'].is_a? Array) raise TypeError, "value '%s' is not an Array" % [hash['fields']] end @fields = [] hash['fields'].each do |e| @fields << Ingenico::Connect::SDK::Domain::Product::PaymentProductField.new_from_hash(e) end end if hash.has_key?('id') @id = hash['id'] end end |
#to_h ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_group.rb', line 29 def to_h hash = super add_to_hash(hash, 'accountsOnFile', @accounts_on_file) add_to_hash(hash, 'displayHints', @display_hints) add_to_hash(hash, 'fields', @fields) add_to_hash(hash, 'id', @id) hash end |