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
Direct Known Subclasses
Instance Attribute Summary collapse
-
#accounts_on_file ⇒ Array<Ingenico::Connect::SDK::Domain::Product::AccountOnFile>
The current value of accounts_on_file.
-
#device_fingerprint_enabled ⇒ true/false
The current value of device_fingerprint_enabled.
-
#display_hints ⇒ Ingenico::Connect::SDK::Domain::Product::PaymentProductDisplayHints
The current value of display_hints.
-
#fields ⇒ Array<Ingenico::Connect::SDK::Domain::Product::PaymentProductField>
The current value of fields.
-
#id ⇒ String
The current value of id.
Instance Method Summary collapse
Methods inherited from Ingenico::Connect::SDK::DataObject
Instance Attribute Details
#accounts_on_file ⇒ Array<Ingenico::Connect::SDK::Domain::Product::AccountOnFile>
Returns the current value of accounts_on_file.
19 20 21 |
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_group.rb', line 19 def accounts_on_file @accounts_on_file end |
#device_fingerprint_enabled ⇒ true/false
Returns the current value of device_fingerprint_enabled.
19 20 21 |
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_group.rb', line 19 def device_fingerprint_enabled @device_fingerprint_enabled end |
#display_hints ⇒ Ingenico::Connect::SDK::Domain::Product::PaymentProductDisplayHints
Returns the current value of display_hints.
19 20 21 |
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_group.rb', line 19 def display_hints @display_hints end |
#fields ⇒ Array<Ingenico::Connect::SDK::Domain::Product::PaymentProductField>
Returns the current value of fields.
19 20 21 |
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_group.rb', line 19 def fields @fields end |
#id ⇒ String
Returns the current value of id.
19 20 21 |
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_group.rb', line 19 def id @id end |
Instance Method Details
#from_hash(hash) ⇒ Object
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 68 |
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_group.rb', line 42 def from_hash(hash) super if hash.has_key? 'accountsOnFile' raise TypeError, "value '%s' is not an Array" % [hash['accountsOnFile']] unless hash['accountsOnFile'].is_a? Array @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? 'deviceFingerprintEnabled' @device_fingerprint_enabled = hash['deviceFingerprintEnabled'] end if hash.has_key? 'displayHints' raise TypeError, "value '%s' is not a Hash" % [hash['displayHints']] unless hash['displayHints'].is_a? Hash @display_hints = Ingenico::Connect::SDK::Domain::Product::PaymentProductDisplayHints.new_from_hash(hash['displayHints']) end if hash.has_key? 'fields' raise TypeError, "value '%s' is not an Array" % [hash['fields']] unless hash['fields'].is_a? Array @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 ⇒ Hash
32 33 34 35 36 37 38 39 40 |
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_group.rb', line 32 def to_h hash = super hash['accountsOnFile'] = @accounts_on_file.collect{|val| val.to_h} unless @accounts_on_file.nil? hash['deviceFingerprintEnabled'] = @device_fingerprint_enabled unless @device_fingerprint_enabled.nil? hash['displayHints'] = @display_hints.to_h unless @display_hints.nil? hash['fields'] = @fields.collect{|val| val.to_h} unless @fields.nil? hash['id'] = @id unless @id.nil? hash end |