Module: JSI::SchemaModule::MetaSchemaModule

Included in:
JSONSchemaDraft04, JSONSchemaDraft06, JSONSchemaDraft07, JSONSchemaDraft202012
Defined in:
lib/jsi/schema_classes.rb

Overview

A module to extend the JSI::SchemaModule of a schema which describes other schemas (a JSI::Schema::MetaSchema)

Instance Method Summary collapse

Instance Method Details

#described_dialectSchema::Dialect

Returns:



175
176
177
# File 'lib/jsi/schema_classes.rb', line 175

def described_dialect
  schema.described_dialect
end

#new_schema(schema_content, **kw, &block) ⇒ Base + Schema

Instantiates the given schema content as a JSI Schema.

See JSI::Schema::MetaSchema#new_schema.

Returns:

  • (Base + Schema)

    A JSI which is a JSI::Schema whose content comes from the given schema_content and whose schemas are in-place applicators of this module's schema.



165
166
167
# File 'lib/jsi/schema_classes.rb', line 165

def new_schema(schema_content, **kw, &block)
  schema.new_schema(schema_content, **kw, &block)
end

#new_schema_module(schema_content, **kw) { ... } ⇒ JSI::SchemaModule

Instantiates the given schema content as a JSI Schema, passing all params to JSI::Schema::MetaSchema#new_schema, and returns its JSI Schema Module.

Yields:

  • If a block is given, it is evaluated in the context of the schema module using Module#module_exec.

Returns:



170
171
172
# File 'lib/jsi/schema_classes.rb', line 170

def new_schema_module(schema_content, **kw, &block)
  schema.new_schema_module(schema_content, **kw, &block)
end