Class: Odin::Types::SchemaType
- Inherits:
-
Object
- Object
- Odin::Types::SchemaType
- Defined in:
- lib/odin/types/schema.rb
Overview
Schema type definition (named object structure)
Instance Attribute Summary collapse
-
#base_type ⇒ Object
readonly
Returns the value of attribute base_type.
-
#composition ⇒ Object
readonly
Returns the value of attribute composition.
-
#constraints ⇒ Object
readonly
Returns the value of attribute constraints.
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#intersection_types ⇒ Object
readonly
Returns the value of attribute intersection_types.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#namespace ⇒ Object
readonly
Returns the value of attribute namespace.
-
#parent_types ⇒ Object
readonly
Returns the value of attribute parent_types.
Instance Method Summary collapse
-
#initialize(name:, fields: {}, namespace: nil, composition: nil, base_type: nil, constraints: nil, intersection_types: nil, parent_types: nil) ⇒ SchemaType
constructor
A new instance of SchemaType.
Constructor Details
#initialize(name:, fields: {}, namespace: nil, composition: nil, base_type: nil, constraints: nil, intersection_types: nil, parent_types: nil) ⇒ SchemaType
Returns a new instance of SchemaType.
159 160 161 162 163 164 165 166 167 168 169 170 171 |
# File 'lib/odin/types/schema.rb', line 159 def initialize(name:, fields: {}, namespace: nil, composition: nil, base_type: nil, constraints: nil, intersection_types: nil, parent_types: nil) @name = name.freeze @fields = fields.freeze @namespace = namespace&.freeze @composition = composition @base_type = base_type @constraints = (constraints || {}).freeze @intersection_types = intersection_types&.freeze @parent_types = parent_types&.freeze freeze end |
Instance Attribute Details
#base_type ⇒ Object (readonly)
Returns the value of attribute base_type.
156 157 158 |
# File 'lib/odin/types/schema.rb', line 156 def base_type @base_type end |
#composition ⇒ Object (readonly)
Returns the value of attribute composition.
156 157 158 |
# File 'lib/odin/types/schema.rb', line 156 def composition @composition end |
#constraints ⇒ Object (readonly)
Returns the value of attribute constraints.
156 157 158 |
# File 'lib/odin/types/schema.rb', line 156 def constraints @constraints end |
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
156 157 158 |
# File 'lib/odin/types/schema.rb', line 156 def fields @fields end |
#intersection_types ⇒ Object (readonly)
Returns the value of attribute intersection_types.
156 157 158 |
# File 'lib/odin/types/schema.rb', line 156 def intersection_types @intersection_types end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
156 157 158 |
# File 'lib/odin/types/schema.rb', line 156 def name @name end |
#namespace ⇒ Object (readonly)
Returns the value of attribute namespace.
156 157 158 |
# File 'lib/odin/types/schema.rb', line 156 def namespace @namespace end |
#parent_types ⇒ Object (readonly)
Returns the value of attribute parent_types.
156 157 158 |
# File 'lib/odin/types/schema.rb', line 156 def parent_types @parent_types end |