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.



82
83
84
85
86
87
# File 'lib/odin/types/schema.rb', line 82

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.



80
81
82
# File 'lib/odin/types/schema.rb', line 80

def kind
  @kind
end

#max_lengthObject (readonly)

Returns the value of attribute max_length.



80
81
82
# File 'lib/odin/types/schema.rb', line 80

def max_length
  @max_length
end

#min_lengthObject (readonly)

Returns the value of attribute min_length.



80
81
82
# File 'lib/odin/types/schema.rb', line 80

def min_length
  @min_length
end