Class: Ingenico::Direct::SDK::Domain::PaymentProductFieldDataRestrictions
- Inherits:
-
Ingenico::Direct::SDK::DataObject
- Object
- Ingenico::Direct::SDK::DataObject
- Ingenico::Direct::SDK::Domain::PaymentProductFieldDataRestrictions
- Defined in:
- lib/ingenico/direct/sdk/domain/payment_product_field_data_restrictions.rb
Instance Attribute Summary collapse
-
#is_required ⇒ true/false
The current value of is_required.
-
#validators ⇒ Ingenico::Direct::SDK::Domain::PaymentProductFieldValidators
The current value of validators.
Instance Method Summary collapse
Methods inherited from Ingenico::Direct::SDK::DataObject
Instance Attribute Details
#is_required ⇒ true/false
Returns the current value of is_required.
13 14 15 |
# File 'lib/ingenico/direct/sdk/domain/payment_product_field_data_restrictions.rb', line 13 def is_required @is_required end |
#validators ⇒ Ingenico::Direct::SDK::Domain::PaymentProductFieldValidators
Returns the current value of validators.
13 14 15 |
# File 'lib/ingenico/direct/sdk/domain/payment_product_field_data_restrictions.rb', line 13 def validators @validators end |
Instance Method Details
#from_hash(hash) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/ingenico/direct/sdk/domain/payment_product_field_data_restrictions.rb', line 25 def from_hash(hash) super @is_required = hash['isRequired'] if hash.key? 'isRequired' if hash.key? 'validators' raise TypeError, "value '%s' is not a Hash" % [hash['validators']] unless hash['validators'].is_a? Hash @validators = Ingenico::Direct::SDK::Domain::PaymentProductFieldValidators.new_from_hash(hash['validators']) end end |
#to_h ⇒ Hash
18 19 20 21 22 23 |
# File 'lib/ingenico/direct/sdk/domain/payment_product_field_data_restrictions.rb', line 18 def to_h hash = super hash['isRequired'] = @is_required unless @is_required.nil? hash['validators'] = @validators.to_h if @validators hash end |