Module: Dry::Plugins::DSL

Defined in:
lib/dry/plugins/dsl.rb

Overview

Plug-ins DSL

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(plugins) ⇒ 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.



10
11
12
13
14
15
16
17
# File 'lib/dry/plugins/dsl.rb', line 10

def self.extended(plugins)
  super(plugins)
  plugins.extend SingleForwardable
  plugins.def_single_delegators Plugins.config.registry_method,
                                :register,
                                :resolve,
                                :[]
end

Instance Method Details

#hostModule, Host::DSL

Returns:



20
21
22
# File 'lib/dry/plugins/dsl.rb', line 20

def host
  @host ||= Inflecto.constantize(name.gsub(/::[^:]+$/, ''))
end

#plugins_registryRegistry

Returns:

See Also:



# File 'lib/dry/plugins/dsl.rb', line 39

#register(name, plugin) ⇒ Plugin

Parameters:

  • name (#to_sym)
  • plugin (Module, Plugin)

Returns:

See Also:



# File 'lib/dry/plugins/dsl.rb', line 24

#resolve(name) ⇒ Plugin

Parameters:

  • name (#to_sym)

Returns:

See Also:



# File 'lib/dry/plugins/dsl.rb', line 32