Module: JSI::SchemaModule::DescribesSchemaModule

Included in:
JSONSchemaDraft04, JSONSchemaDraft06, JSONSchemaDraft07
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::DescribesSchema)

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#schema_implementation_modulesSet<Module> (readonly)



89
90
91
# File 'lib/jsi/schema_classes.rb', line 89

def schema_implementation_modules
  @schema_implementation_modules
end

Instance Method Details

#new_schema(schema_content, **kw) { ... } ⇒ JSI::Base subclass + JSI::Schema

Instantiates the given schema content as a JSI Schema.

see JSI::Schema::DescribesSchema#new_schema

Yields:

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



79
80
81
# File 'lib/jsi/schema_classes.rb', line 79

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

#new_schema_module(schema_content, **kw, &block) ⇒ Module + JSI::SchemaModule

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



84
85
86
# File 'lib/jsi/schema_classes.rb', line 84

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