Class: Odin::Types::BoundsConstraint

Inherits:
Object
  • Object
show all
Defined in:
lib/odin/types/schema.rb

Overview

Constraint types

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(min: nil, max: nil, exclusive_min: nil, exclusive_max: nil) ⇒ BoundsConstraint

Returns a new instance of BoundsConstraint.



47
48
49
50
51
52
53
54
# File 'lib/odin/types/schema.rb', line 47

def initialize(min: nil, max: nil, exclusive_min: nil, exclusive_max: nil)
  @kind = :bounds
  @min = min
  @max = max
  @exclusive_min = exclusive_min
  @exclusive_max = exclusive_max
  freeze
end

Instance Attribute Details

#exclusive_maxObject (readonly)

Returns the value of attribute exclusive_max.



45
46
47
# File 'lib/odin/types/schema.rb', line 45

def exclusive_max
  @exclusive_max
end

#exclusive_minObject (readonly)

Returns the value of attribute exclusive_min.



45
46
47
# File 'lib/odin/types/schema.rb', line 45

def exclusive_min
  @exclusive_min
end

#kindObject (readonly)

Returns the value of attribute kind.



45
46
47
# File 'lib/odin/types/schema.rb', line 45

def kind
  @kind
end

#maxObject (readonly)

Returns the value of attribute max.



45
46
47
# File 'lib/odin/types/schema.rb', line 45

def max
  @max
end

#minObject (readonly)

Returns the value of attribute min.



45
46
47
# File 'lib/odin/types/schema.rb', line 45

def min
  @min
end