Class: OnlinePayments::SDK::Domain::RangeValidator

Inherits:
OnlinePayments::SDK::DataObject show all
Defined in:
lib/onlinepayments/sdk/domain/range_validator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from OnlinePayments::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



11
12
13
# File 'lib/onlinepayments/sdk/domain/range_validator.rb', line 11

def max_value
  @max_value
end

#min_valueInteger

Returns the current value of min_value.

Returns:

  • (Integer)

    the current value of min_value



11
12
13
# File 'lib/onlinepayments/sdk/domain/range_validator.rb', line 11

def min_value
  @min_value
end

Instance Method Details

#from_hash(hash) ⇒ Object



23
24
25
26
27
# File 'lib/onlinepayments/sdk/domain/range_validator.rb', line 23

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

#to_hHash

Returns:

  • (Hash)


16
17
18
19
20
21
# File 'lib/onlinepayments/sdk/domain/range_validator.rb', line 16

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