class Dry::Schema::Macros::Array

@api private
Macro used to specify predicates for each element of an array

def to_ast(*)

Other tags:
    Api: - private
def to_ast(*)
  [:and, [trace.array?.to_ast, [:each, trace.to_ast]]]
end

def value(*args, **opts, &block)

Other tags:
    Api: - private
def value(*args, **opts, &block)
  type(:array)
  extract_type_spec(args, set_type: false) do |*predicates, type_spec:, type_rule:|
    type(schema_dsl.array[type_spec]) if type_spec
    is_hash_block = type_spec.equal?(:hash)
    if predicates.any? || opts.any? || !is_hash_block
      super(
        *predicates, type_spec: type_spec, type_rule: type_rule, **opts,
        &(is_hash_block ? nil : block)
      )
    end
    is_op = args.size.equal?(2) && args[1].is_a?(Logic::Operations::Abstract)
    if is_hash_block && !is_op
      hash(&block)
    elsif is_op
      hash = Value.new(schema_dsl: schema_dsl.new, name: name).hash(args[1])
      trace.captures.concat(hash.trace.captures)
      type(schema_dsl.types[name].of(hash.schema_dsl.types[name]))
    end
  end
  self
end