Class: Odin::Types::BoundsConstraint
- Inherits:
-
Object
- Object
- Odin::Types::BoundsConstraint
- Defined in:
- lib/odin/types/schema.rb
Overview
Constraint types
Instance Attribute Summary collapse
-
#exclusive_max ⇒ Object
readonly
Returns the value of attribute exclusive_max.
-
#exclusive_min ⇒ Object
readonly
Returns the value of attribute exclusive_min.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#max ⇒ Object
readonly
Returns the value of attribute max.
-
#min ⇒ Object
readonly
Returns the value of attribute min.
Instance Method Summary collapse
-
#initialize(min: nil, max: nil, exclusive_min: nil, exclusive_max: nil) ⇒ BoundsConstraint
constructor
A new instance of BoundsConstraint.
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_max ⇒ Object (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_min ⇒ Object (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 |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
45 46 47 |
# File 'lib/odin/types/schema.rb', line 45 def kind @kind end |
#max ⇒ Object (readonly)
Returns the value of attribute max.
45 46 47 |
# File 'lib/odin/types/schema.rb', line 45 def max @max end |
#min ⇒ Object (readonly)
Returns the value of attribute min.
45 46 47 |
# File 'lib/odin/types/schema.rb', line 45 def min @min end |