Class: OnlinePayments::SDK::Domain::LengthValidator
- Inherits:
-
OnlinePayments::SDK::DataObject
- Object
- OnlinePayments::SDK::DataObject
- OnlinePayments::SDK::Domain::LengthValidator
- Defined in:
- lib/onlinepayments/sdk/domain/length_validator.rb
Instance Attribute Summary collapse
-
#max_length ⇒ Integer
The current value of max_length.
-
#min_length ⇒ Integer
The current value of min_length.
Instance Method Summary collapse
Methods inherited from OnlinePayments::SDK::DataObject
Instance Attribute Details
#max_length ⇒ Integer
Returns the current value of max_length.
11 12 13 |
# File 'lib/onlinepayments/sdk/domain/length_validator.rb', line 11 def max_length @max_length end |
#min_length ⇒ Integer
Returns the current value of min_length.
11 12 13 |
# File 'lib/onlinepayments/sdk/domain/length_validator.rb', line 11 def min_length @min_length end |
Instance Method Details
#from_hash(hash) ⇒ Object
23 24 25 26 27 |
# File 'lib/onlinepayments/sdk/domain/length_validator.rb', line 23 def from_hash(hash) super @max_length = hash['maxLength'] if hash.key? 'maxLength' @min_length = hash['minLength'] if hash.key? 'minLength' end |
#to_h ⇒ Hash
16 17 18 19 20 21 |
# File 'lib/onlinepayments/sdk/domain/length_validator.rb', line 16 def to_h hash = super hash['maxLength'] = @max_length unless @max_length.nil? hash['minLength'] = @min_length unless @min_length.nil? hash end |