lib/dry/schema/config.rb in dry-schema-1.4.3 vs lib/dry/schema/config.rb in dry-schema-1.5.0

- old
+ new

@@ -1,13 +1,13 @@ # frozen_string_literal: true -require 'dry/equalizer' -require 'dry/configurable' +require "dry/equalizer" +require "dry/configurable" -require 'dry/schema/constants' -require 'dry/schema/predicate_registry' -require 'dry/schema/type_container' +require "dry/schema/constants" +require "dry/schema/predicate_registry" +require "dry/schema/type_container" module Dry module Schema # Schema definition configuration class # @@ -49,17 +49,26 @@ setting(:load_paths, Set[DEFAULT_MESSAGES_PATH], &:dup) setting(:top_namespace, DEFAULT_MESSAGES_ROOT) setting(:default_locale, nil) end + # @!method validate_keys + # + # On/off switch for key validator + # + # @return [Boolean] + # + # @api public + setting(:validate_keys, false) + # @api private def respond_to_missing?(meth, include_private = false) super || config.respond_to?(meth, include_private) end # @api private def inspect - "#<#{self.class} #{to_h.map { |k, v| ["#{k}=", v.inspect] }.map(&:join).join(' ')}>" + "#<#{self.class} #{to_h.map { |k, v| ["#{k}=", v.inspect] }.map(&:join).join(" ")}>" end private # Forward to the underlying config object