lib/dry/schema/config.rb in dry-schema-1.7.1 vs lib/dry/schema/config.rb in dry-schema-1.8.0

- old
+ new

@@ -23,43 +23,43 @@ # Return configured predicate registry # # @return [Schema::PredicateRegistry] # # @api public - setting(:predicates, Schema::PredicateRegistry.new) + setting :predicates, default: Schema::PredicateRegistry.new # @!method types # # Return configured container with extra types # # @return [Hash] # # @api public - setting(:types, Dry::Types) + setting :types, default: Dry::Types # @!method messages # # Return configuration for message backend # # @return [Dry::Configurable::Config] # # @api public - setting(:messages) do - setting(:backend, :yaml) - setting(:namespace) - setting(:load_paths, Set[DEFAULT_MESSAGES_PATH], &:dup) - setting(:top_namespace, DEFAULT_MESSAGES_ROOT) - setting(:default_locale, nil) + setting :messages do + setting :backend, default: :yaml + setting :namespace + setting :load_paths, default: Set[DEFAULT_MESSAGES_PATH], constructor: :dup.to_proc + setting :top_namespace, default: DEFAULT_MESSAGES_ROOT + setting :default_locale end # @!method validate_keys # # On/off switch for key validator # # @return [Boolean] # # @api public - setting(:validate_keys, false) + setting :validate_keys, default: false # @api private def respond_to_missing?(meth, include_private = false) super || config.respond_to?(meth, include_private) end