Method: Dry::System::Config::ComponentDir#instance=
- Defined in:
- lib/dry/system/config/component_dir.rb
#instance=(instance_proc) ⇒ Proc
Sets a proc used to return the instance of any component within the component dir.
This proc should accept a Dry::System::Component and return the object to serve as the component’s instance.
When you provide an instance proc, it will be used in preference to the #loader (either the default loader or an explicitly configured one). Provide an instance proc when you want a simple way to customize the instance for certain components. For complete control, provide a replacement loader via #loader=.
Defaults to ‘nil`.
90 |
# File 'lib/dry/system/config/component_dir.rb', line 90 setting :instance |