Module: JSI::SchemaClasses Private
- Defined in:
- lib/jsi/schema_classes.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
this module is a namespace for building schema classes and schema modules.
Class Method Summary collapse
-
.bootstrap_schema_class(modules) ⇒ Class
private
a subclass of MetaSchemaNode::BootstrapSchema with the given modules included.
-
.class_for_schemas(schemas, includes:, mutable:) ⇒ Class subclassing JSI::Base
private
a JSI Schema Class which represents the given schemas.
- .module_for_schema(schema) ⇒ SchemaModule private
Class Method Details
.bootstrap_schema_class(modules) ⇒ Class
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
a subclass of MetaSchemaNode::BootstrapSchema with the given modules included
164 165 166 167 168 |
# File 'lib/jsi/schema_classes.rb', line 164 def bootstrap_schema_class(modules) @bootstrap_schema_class_map[ modules: Util.ensure_module_set(modules), ] end |
.class_for_schemas(schemas, includes:, mutable:) ⇒ Class subclassing JSI::Base
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
a JSI Schema Class which represents the given schemas. an instance of the class is a JSON Schema instance described by all of the given schemas.
116 117 118 119 120 121 122 |
# File 'lib/jsi/schema_classes.rb', line 116 def class_for_schemas(schemas, includes: , mutable: ) @class_for_schemas_map[ schemas: SchemaSet.ensure_schema_set(schemas), includes: Util.ensure_module_set(includes), mutable: mutable, ] end |
.module_for_schema(schema) ⇒ SchemaModule
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
183 184 185 186 187 |
# File 'lib/jsi/schema_classes.rb', line 183 def module_for_schema(schema) Schema.ensure_schema(schema) raise(Bug, "non-Base schema cannot have schema module: #{schema}") unless schema.is_a?(Base) @schema_module_map[schema] end |