Class: Odin::Types::SizeConstraint

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(min_length: nil, max_length: nil) ⇒ SizeConstraint

Returns a new instance of SizeConstraint.



92
93
94
95
96
97
# File 'lib/odin/types/schema.rb', line 92

def initialize(min_length: nil, max_length: nil)
  @kind = :size
  @min_length = min_length
  @max_length = max_length
  freeze
end

Instance Attribute Details

#kindObject (readonly)

Returns the value of attribute kind.



90
91
92
# File 'lib/odin/types/schema.rb', line 90

def kind
  @kind
end

#max_lengthObject (readonly)

Returns the value of attribute max_length.



90
91
92
# File 'lib/odin/types/schema.rb', line 90

def max_length
  @max_length
end

#min_lengthObject (readonly)

Returns the value of attribute min_length.



90
91
92
# File 'lib/odin/types/schema.rb', line 90

def min_length
  @min_length
end