Class: Ingenico::Connect::SDK::Domain::Product::PaymentProductField
- Inherits:
-
Ingenico::Connect::SDK::DataObject
- Object
- Ingenico::Connect::SDK::DataObject
- Ingenico::Connect::SDK::Domain::Product::PaymentProductField
- Defined in:
- lib/ingenico/connect/sdk/domain/product/payment_product_field.rb
Instance Attribute Summary collapse
- #data_restrictions ⇒ Object
- #display_hints ⇒ Object
-
#id ⇒ Object
String.
-
#type ⇒ Object
String.
-
#used_for_lookup ⇒ Object
true/false.
Instance Method Summary collapse
Methods inherited from Ingenico::Connect::SDK::DataObject
Instance Attribute Details
#data_restrictions ⇒ Object
16 17 18 |
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field.rb', line 16 def data_restrictions @data_restrictions end |
#display_hints ⇒ Object
19 20 21 |
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field.rb', line 19 def display_hints @display_hints end |
#id ⇒ Object
String
22 23 24 |
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field.rb', line 22 def id @id end |
#type ⇒ Object
String
25 26 27 |
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field.rb', line 25 def type @type end |
#used_for_lookup ⇒ Object
true/false
28 29 30 |
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field.rb', line 28 def used_for_lookup @used_for_lookup end |
Instance Method Details
#from_hash(hash) ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field.rb', line 40 def from_hash(hash) super if hash.has_key?('dataRestrictions') if !(hash['dataRestrictions'].is_a? Hash) raise TypeError, "value '%s' is not a Hash" % [hash['dataRestrictions']] end @data_restrictions = Ingenico::Connect::SDK::Domain::Product::PaymentProductFieldDataRestrictions.new_from_hash(hash['dataRestrictions']) 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::PaymentProductFieldDisplayHints.new_from_hash(hash['displayHints']) end if hash.has_key?('id') @id = hash['id'] end if hash.has_key?('type') @type = hash['type'] end if hash.has_key?('usedForLookup') @used_for_lookup = hash['usedForLookup'] end end |
#to_h ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'lib/ingenico/connect/sdk/domain/product/payment_product_field.rb', line 30 def to_h hash = super add_to_hash(hash, 'dataRestrictions', @data_restrictions) add_to_hash(hash, 'displayHints', @display_hints) add_to_hash(hash, 'id', @id) add_to_hash(hash, 'type', @type) add_to_hash(hash, 'usedForLookup', @used_for_lookup) hash end |