class Dry::Schema::Macros::Key

@api public
Base macro for specifying rules applied to a value found under a key

def filter(...)

Other tags:
    Api: - public

Returns:
  • (Macros::Key) -

Other tags:
    See: Macros::Key#value -

Other tags:
    Example: check format before coercing to a date -
def filter(...)
  (filter_schema_dsl[name] || filter_schema_dsl.optional(name)).value(...)
  self
end

def to_ast

Other tags:
    Api: - private
def to_ast
  [:predicate, [:key?, [[:name, name], [:input, Undefined]]]]
end

def to_rule

Other tags:
    Api: - private

Returns:
  • (Dry::Logic::Rule) -
def to_rule
  if trace.captures.empty?
    super
  else
    [super, trace.to_rule(name)].reduce(operation)
  end
end