Class: Ingenico::Connect::SDK::Domain::Product::RangeValidator

Inherits:
Ingenico::Connect::SDK::DataObject show all
Defined in:
lib/ingenico/connect/sdk/domain/product/range_validator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Connect::SDK::DataObject

new_from_hash

Instance Attribute Details

#max_valueInteger

Returns the current value of max_value.

Returns:

  • (Integer)

    the current value of max_value



13
14
15
# File 'lib/ingenico/connect/sdk/domain/product/range_validator.rb', line 13

def max_value
  @max_value
end

#min_valueInteger

Returns the current value of min_value.

Returns:

  • (Integer)

    the current value of min_value



13
14
15
# File 'lib/ingenico/connect/sdk/domain/product/range_validator.rb', line 13

def min_value
  @min_value
end

Instance Method Details

#from_hash(hash) ⇒ Object



27
28
29
30
31
32
33
34
35
# File 'lib/ingenico/connect/sdk/domain/product/range_validator.rb', line 27

def from_hash(hash)
  super
  if hash.has_key? 'maxValue'
    @max_value = hash['maxValue']
  end
  if hash.has_key? 'minValue'
    @min_value = hash['minValue']
  end
end

#to_hHash

Returns:

  • (Hash)


20
21
22
23
24
25
# File 'lib/ingenico/connect/sdk/domain/product/range_validator.rb', line 20

def to_h
  hash = super
  hash['maxValue'] = @max_value unless @max_value.nil?
  hash['minValue'] = @min_value unless @min_value.nil?
  hash
end