Module: JSI::JSONSchemaDraft202012

Extended by:
SchemaModule::MetaSchemaModule
Includes:
PropertyReaders
Defined in:
lib/schemas/json-schema.org/draft/2020-12/schema.rb,
lib/schemas/json-schema.org/draft/2020-12/schema.rb

Defined Under Namespace

Modules: Applicator, Content, Core, FormatAnnotation, MetaData, PropertyReaders, Unevaluated, Validation

Class Method Summary collapse

Instance Method Summary collapse

Methods included from SchemaModule::MetaSchemaModule

described_dialect, new_schema, new_schema_module

Methods included from PropertyReaders

#anchor, #comment, #defs, #dynamicAnchor, #dynamicRef, #format, #ref

Class Method Details

.name_vocab_schemas(metaschema_module, namespace: metaschema_module) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/schemas/json-schema.org/draft/2020-12/schema.rb', line 20

def self.name_vocab_schemas(metaschema_module, namespace: metaschema_module)
  find_module = proc { |uri| metaschema_module.schema.jsi_registry.find(uri).with_dynamic_scope_from(metaschema_module).jsi_schema_module }
  namespace.const_set(:Core,       find_module["https://json-schema.org/draft/2020-12/meta/core"])
  namespace.const_set(:Applicator,  find_module["https://json-schema.org/draft/2020-12/meta/applicator"])
  namespace.const_set(:Unevaluated,  find_module["https://json-schema.org/draft/2020-12/meta/unevaluated"])
  namespace.const_set(:Validation,    find_module["https://json-schema.org/draft/2020-12/meta/validation"])
  namespace.const_set(:MetaData,       find_module["https://json-schema.org/draft/2020-12/meta/meta-data"])
  namespace.const_set(:FormatAnnotation, find_module["https://json-schema.org/draft/2020-12/meta/format-annotation"])
  namespace.const_set(:Content,         find_module["https://json-schema.org/draft/2020-12/meta/content"])
  metaschema_module
end

Instance Method Details

#jsi_schema_module_connection_created(mod) ⇒ Object



51
52
53
54
# File 'lib/schemas/json-schema.org/draft/2020-12/schema.rb', line 51

def jsi_schema_module_connection_created(mod)
  mod.define_singleton_method(:defs) { |**kw| self['$defs', **kw] }
  super
end