Class: Ingenico::Direct::SDK::Domain::LengthValidator

Inherits:
Ingenico::Direct::SDK::DataObject show all
Defined in:
lib/ingenico/direct/sdk/domain/length_validator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Direct::SDK::DataObject

new_from_hash

Instance Attribute Details

#max_lengthInteger

Returns the current value of max_length.

Returns:

  • (Integer)

    the current value of max_length



12
13
14
# File 'lib/ingenico/direct/sdk/domain/length_validator.rb', line 12

def max_length
  @max_length
end

#min_lengthInteger

Returns the current value of min_length.

Returns:

  • (Integer)

    the current value of min_length



12
13
14
# File 'lib/ingenico/direct/sdk/domain/length_validator.rb', line 12

def min_length
  @min_length
end

Instance Method Details

#from_hash(hash) ⇒ Object



24
25
26
27
28
# File 'lib/ingenico/direct/sdk/domain/length_validator.rb', line 24

def from_hash(hash)
  super
  @max_length = hash['maxLength'] if hash.key? 'maxLength'
  @min_length = hash['minLength'] if hash.key? 'minLength'
end

#to_hHash

Returns:

  • (Hash)


17
18
19
20
21
22
# File 'lib/ingenico/direct/sdk/domain/length_validator.rb', line 17

def to_h
  hash = super
  hash['maxLength'] = @max_length unless @max_length.nil?
  hash['minLength'] = @min_length unless @min_length.nil?
  hash
end