Module: SmartCore::Container::RegistryBuilder Private
- Defined in:
- lib/smart_core/container/registry_builder.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Class Method Summary collapse
- .build(container, ignored_definition_commands: [], ignored_instantiation_commands: []) ⇒ SmartCore::Container::Registry private
- .define(container_klass, registry, ignored_commands: []) ⇒ void private
- .instantiate(container_klass, registry, ignored_commands: []) ⇒ void private
Class Method Details
.build(container, ignored_definition_commands: [], ignored_instantiation_commands: []) ⇒ SmartCore::Container::Registry
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.
15 16 17 18 19 20 |
# File 'lib/smart_core/container/registry_builder.rb', line 15 def build(container, ignored_definition_commands: [], ignored_instantiation_commands: []) SmartCore::Container::Registry.new.tap do |registry| define(container.class, registry, ignored_commands: ignored_definition_commands) instantiate(container.class, registry, ignored_commands: ignored_instantiation_commands) end end |
.define(container_klass, registry, ignored_commands: []) ⇒ void
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.
This method returns an undefined value.
29 30 31 32 33 34 |
# File 'lib/smart_core/container/registry_builder.rb', line 29 def define(container_klass, registry, ignored_commands: []) container_klass.__container_definition_commands__.each do |command| next if ignored_commands.include?(command.class) command.call(registry) end end |
.instantiate(container_klass, registry, ignored_commands: []) ⇒ void
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.
This method returns an undefined value.
43 44 45 46 47 48 |
# File 'lib/smart_core/container/registry_builder.rb', line 43 def instantiate(container_klass, registry, ignored_commands: []) container_klass.__container_instantiation_commands__.each do |command| next if ignored_commands.include?(command.class) command.call(registry) end end |