Class: Dry::Schema::Config
- Inherits:
-
Object
- Object
- Dry::Schema::Config
- Includes:
- Configurable
- Defined in:
- lib/dry/schema/config.rb
Overview
Schema definition configuration class
Instance Method Summary collapse
- #inspect ⇒ Object private
-
#messages ⇒ Dry::Configurable::Config
Return configuration for message backend.
-
#predicates ⇒ Schema::PredicateRegistry
Return configured predicate registry.
- #respond_to_missing?(meth, include_private = false) ⇒ Boolean private
-
#types ⇒ Hash
Return configured container with extra types.
-
#validate_keys ⇒ Boolean
On/off switch for key validator.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args, &block) ⇒ Object (private)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Forward to the underlying config object
78 79 80 81 |
# File 'lib/dry/schema/config.rb', line 78 def method_missing(meth, *args, &block) super unless config.respond_to?(meth) config.public_send(meth, *args) end |
Instance Method Details
#inspect ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
69 70 71 |
# File 'lib/dry/schema/config.rb', line 69 def inspect "#<#{self.class} #{to_h.map { |k, v| ["#{k}=", v.inspect] }.map(&:join).join(" ")}>" end |
#messages ⇒ Dry::Configurable::Config
Return configuration for message backend
46 47 48 49 50 51 52 |
# File 'lib/dry/schema/config.rb', line 46 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 |
#predicates ⇒ Schema::PredicateRegistry
Return configured predicate registry
28 |
# File 'lib/dry/schema/config.rb', line 28 setting :predicates, default: Schema::PredicateRegistry.new |
#respond_to_missing?(meth, include_private = false) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
64 65 66 |
# File 'lib/dry/schema/config.rb', line 64 def respond_to_missing?(meth, include_private = false) super || config.respond_to?(meth, include_private) end |
#types ⇒ Hash
Return configured container with extra types
37 |
# File 'lib/dry/schema/config.rb', line 37 setting :types, default: Dry::Types |
#validate_keys ⇒ Boolean
On/off switch for key validator
61 |
# File 'lib/dry/schema/config.rb', line 61 setting :validate_keys, default: false |