Module: JSONSkooma::Keywords::ValueSchemas::ObjectOfSchemas

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

Instance Method Summary collapse

Instance Method Details

#each_schema(&block) ⇒ Object



78
79
80
81
82
# File 'lib/json_skooma/keywords/value_schemas.rb', line 78

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

  json.each_value(&block)
end

#wrap_value(value) ⇒ Object



65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/json_skooma/keywords/value_schemas.rb', line 65

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

  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