Module: JSONSkooma::Keywords::ValueSchemas::ArrayOfSchemas

Defined in:
lib/json_skooma/keywords/value_schemas.rb

Instance Method Summary collapse

Instance Method Details

#each_schema(&block) ⇒ Object



55
56
57
58
59
# File 'lib/json_skooma/keywords/value_schemas.rb', line 55

def each_schema(&block)
  return super unless json.type == "array"

  json.each(&block)
end

#wrap_value(value) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/json_skooma/keywords/value_schemas.rb', line 42

def wrap_value(value)
  return super unless value.is_a?(Array)

  JSONNode.new(
    value,
    parent: parent_schema,
    key: key,
    item_class: self.class.schema_value_class || JSONSchema,
    registry: parent_schema.registry,
    cache_id: parent_schema.cache_id
  )
end