class Ingenico::Connect::SDK::Domain::Product::LengthValidator

@attr [Integer] max_length @attr [Integer] min_length

Attributes

max_length[RW]
min_length[RW]

Public Instance Methods

from_hash(hash) click to toggle source
# File lib/ingenico/connect/sdk/domain/product/length_validator.rb, line 27
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_h() click to toggle source

@return (Hash)

Calls superclass method Ingenico::Connect::SDK::DataObject#to_h
# File lib/ingenico/connect/sdk/domain/product/length_validator.rb, line 20
def to_h
  hash = super
  hash['maxLength'] = @max_length unless @max_length.nil?
  hash['minLength'] = @min_length unless @min_length.nil?
  hash
end