Class: OnlinePayments::SDK::Domain::PaymentProductField
- Inherits:
-
OnlinePayments::SDK::DataObject
- Object
- OnlinePayments::SDK::DataObject
- OnlinePayments::SDK::Domain::PaymentProductField
- Defined in:
- lib/onlinepayments/sdk/domain/payment_product_field.rb
Instance Attribute Summary collapse
-
#data_restrictions ⇒ OnlinePayments::SDK::Domain::PaymentProductFieldDataRestrictions
The current value of data_restrictions.
-
#display_hints ⇒ OnlinePayments::SDK::Domain::PaymentProductFieldDisplayHints
The current value of display_hints.
-
#id ⇒ String
The current value of id.
-
#type ⇒ String
The current value of type.
Instance Method Summary collapse
Methods inherited from OnlinePayments::SDK::DataObject
Instance Attribute Details
#data_restrictions ⇒ OnlinePayments::SDK::Domain::PaymentProductFieldDataRestrictions
Returns the current value of data_restrictions.
15 16 17 |
# File 'lib/onlinepayments/sdk/domain/payment_product_field.rb', line 15 def data_restrictions @data_restrictions end |
#display_hints ⇒ OnlinePayments::SDK::Domain::PaymentProductFieldDisplayHints
Returns the current value of display_hints.
15 16 17 |
# File 'lib/onlinepayments/sdk/domain/payment_product_field.rb', line 15 def display_hints @display_hints end |
#id ⇒ String
Returns the current value of id.
15 16 17 |
# File 'lib/onlinepayments/sdk/domain/payment_product_field.rb', line 15 def id @id end |
#type ⇒ String
Returns the current value of type.
15 16 17 |
# File 'lib/onlinepayments/sdk/domain/payment_product_field.rb', line 15 def type @type end |
Instance Method Details
#from_hash(hash) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/onlinepayments/sdk/domain/payment_product_field.rb', line 31 def from_hash(hash) super if hash.key? 'dataRestrictions' raise TypeError, "value '%s' is not a Hash" % [hash['dataRestrictions']] unless hash['dataRestrictions'].is_a? Hash @data_restrictions = OnlinePayments::SDK::Domain::PaymentProductFieldDataRestrictions.new_from_hash(hash['dataRestrictions']) end if hash.key? 'displayHints' raise TypeError, "value '%s' is not a Hash" % [hash['displayHints']] unless hash['displayHints'].is_a? Hash @display_hints = OnlinePayments::SDK::Domain::PaymentProductFieldDisplayHints.new_from_hash(hash['displayHints']) end @id = hash['id'] if hash.key? 'id' @type = hash['type'] if hash.key? 'type' end |
#to_h ⇒ Hash
22 23 24 25 26 27 28 29 |
# File 'lib/onlinepayments/sdk/domain/payment_product_field.rb', line 22 def to_h hash = super hash['dataRestrictions'] = @data_restrictions.to_h if @data_restrictions hash['displayHints'] = @display_hints.to_h if @display_hints hash['id'] = @id unless @id.nil? hash['type'] = @type unless @type.nil? hash end |