module Performify::Validation::ClassMethods

Public Instance Methods

schema(outer_schema = nil, &block) click to toggle source
# File lib/performify/validation.rb, line 9
def schema(outer_schema = nil, &block)
  if block_given?
    @schema = Dry::Schema.Params(**{}, &block)
  elsif outer_schema.present? && outer_schema.is_a?(Dry::Schema::Params)
    @schema = outer_schema
  else
    @schema
  end
end