Class: JSONSkooma::Metaschema

Inherits:
JSONSchema show all
Defined in:
lib/json_skooma/metaschema.rb

Instance Attribute Summary collapse

Attributes inherited from JSONSchema

#cache_id, #metaschema_uri, #registry, #uri

Attributes inherited from JSONNode

#key, #parent, #type

Instance Method Summary collapse

Methods inherited from JSONSchema

#base_uri, #canonical_uri, #evaluate, #metaschema, #parent_schema, #resolve_ref, #resolve_references, #resolve_uri, #validate

Methods inherited from JSONNode

#!=, #==, #[], #path, #root, #value

Constructor Details

#initialize(value, core_vocabulary, *default_vocabularies, **options) ⇒ Metaschema

Returns a new instance of Metaschema.



8
9
10
11
12
13
# File 'lib/json_skooma/metaschema.rb', line 8

def initialize(value, core_vocabulary, *default_vocabularies, **options)
  @core_vocabulary = core_vocabulary
  @default_vocabularies = default_vocabularies
  @kw_classes = {}
  super(value, cache_id: "__meta__", **options)
end

Instance Attribute Details

#core_vocabularyObject

Returns the value of attribute core_vocabulary.



5
6
7
# File 'lib/json_skooma/metaschema.rb', line 5

def core_vocabulary
  @core_vocabulary
end

#default_vocabulariesObject

Returns the value of attribute default_vocabularies.



5
6
7
# File 'lib/json_skooma/metaschema.rb', line 5

def default_vocabularies
  @default_vocabularies
end

#kw_classesObject (readonly)

Returns the value of attribute kw_classes.



6
7
8
# File 'lib/json_skooma/metaschema.rb', line 6

def kw_classes
  @kw_classes
end

Instance Method Details

#kw_class(key) ⇒ Object



15
16
17
# File 'lib/json_skooma/metaschema.rb', line 15

def kw_class(key)
  kw_classes[key] ||= Keywords::Unknown[key]
end