Class: Worldline::Connect::SDK::V1::Domain::LengthValidator

Inherits:
Domain::DataObject show all
Defined in:
lib/worldline/connect/sdk/v1/domain/length_validator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Domain::DataObject

new_from_hash

Instance Attribute Details

#max_lengthInteger

Returns the current value of max_length.

Returns:

  • (Integer)

    the current value of max_length



14
15
16
# File 'lib/worldline/connect/sdk/v1/domain/length_validator.rb', line 14

def max_length
  @max_length
end

#min_lengthInteger

Returns the current value of min_length.

Returns:

  • (Integer)

    the current value of min_length



14
15
16
# File 'lib/worldline/connect/sdk/v1/domain/length_validator.rb', line 14

def min_length
  @min_length
end

Instance Method Details

#from_hash(hash) ⇒ Object



28
29
30
31
32
33
34
35
36
# File 'lib/worldline/connect/sdk/v1/domain/length_validator.rb', line 28

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

#to_hHash

Returns:

  • (Hash)


21
22
23
24
25
26
# File 'lib/worldline/connect/sdk/v1/domain/length_validator.rb', line 21

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