Method: Dry::Initializer::Config#mixin

Defined in:
lib/dry/initializer/config.rb

#mixinModule (readonly)

Returns reference to the module to be included into class.

Returns:

  • (Module)

    reference to the module to be included into class



26
27
28
29
30
31
32
33
34
35
# File 'lib/dry/initializer/config.rb', line 26

def mixin
  @mixin ||= Module.new.tap do |mod|
    initializer = self
    mod.extend(Mixin::Local)
    mod.define_method(:__dry_initializer_config__) do
      initializer
    end
    mod.send :private, :__dry_initializer_config__
  end
end