Class: SmartCore::Container::DefinitionDSL::Commands::Definition::Register Private
- Inherits:
-
Base
- Object
- Base
- SmartCore::Container::DefinitionDSL::Commands::Definition::Register
- Defined in:
- lib/smart_core/container/definition_dsl/commands/definition/register.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #dependency_name ⇒ String readonly private
Instance Method Summary collapse
- #call(registry) ⇒ void private
- #dup ⇒ SmartCore::Container::DefinitionDSL::Commands::Definition::Register private
- #initialize(dependency_name, dependency_definition) ⇒ void constructor private
Constructor Details
#initialize(dependency_name, dependency_definition) ⇒ 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.
19 20 21 22 23 24 |
# File 'lib/smart_core/container/definition_dsl/commands/definition/register.rb', line 19 def initialize(dependency_name, dependency_definition) SmartCore::Container::KeyGuard.indifferently_accessable_key(dependency_name).tap do |name| @dependency_name = name @dependency_definition = dependency_definition end end |
Instance Attribute Details
#dependency_name ⇒ String (readonly)
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.
11 12 13 |
# File 'lib/smart_core/container/definition_dsl/commands/definition/register.rb', line 11 def dependency_name @dependency_name end |
Instance Method Details
#call(registry) ⇒ 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.
31 32 33 |
# File 'lib/smart_core/container/definition_dsl/commands/definition/register.rb', line 31 def call(registry) registry.register_dependency(dependency_name, &dependency_definition) end |
#dup ⇒ SmartCore::Container::DefinitionDSL::Commands::Definition::Register
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.
39 40 41 |
# File 'lib/smart_core/container/definition_dsl/commands/definition/register.rb', line 39 def dup self.class.new(dependency_name, dependency_definition) end |