Class: Odin::Types::SchemaCardinality
- Inherits:
-
Object
- Object
- Odin::Types::SchemaCardinality
- Defined in:
- lib/odin/types/schema.rb
Overview
Cardinality constraint (:of, :one_of, :exactly_one, :at_most_one)
Instance Attribute Summary collapse
-
#cardinality_type ⇒ Object
readonly
Returns the value of attribute cardinality_type.
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#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(cardinality_type:, fields:, min: nil, max: nil) ⇒ SchemaCardinality
constructor
A new instance of SchemaCardinality.
Constructor Details
#initialize(cardinality_type:, fields:, min: nil, max: nil) ⇒ SchemaCardinality
Returns a new instance of SchemaCardinality.
229 230 231 232 233 234 235 236 |
# File 'lib/odin/types/schema.rb', line 229 def initialize(cardinality_type:, fields:, min: nil, max: nil) @kind = :cardinality @cardinality_type = cardinality_type.freeze @fields = fields.freeze @min = min @max = max freeze end |
Instance Attribute Details
#cardinality_type ⇒ Object (readonly)
Returns the value of attribute cardinality_type.
227 228 229 |
# File 'lib/odin/types/schema.rb', line 227 def cardinality_type @cardinality_type end |
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
227 228 229 |
# File 'lib/odin/types/schema.rb', line 227 def fields @fields end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
227 228 229 |
# File 'lib/odin/types/schema.rb', line 227 def kind @kind end |
#max ⇒ Object (readonly)
Returns the value of attribute max.
227 228 229 |
# File 'lib/odin/types/schema.rb', line 227 def max @max end |
#min ⇒ Object (readonly)
Returns the value of attribute min.
227 228 229 |
# File 'lib/odin/types/schema.rb', line 227 def min @min end |