Class: SmartCore::Container::DefinitionDSL::Commands::Instantiation::Compose Private

Inherits:
Base
  • Object
show all
Defined in:
lib/smart_core/container/definition_dsl/commands/instantiation/compose.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.

Since:

  • 0.1.0

Instance Method Summary collapse

Methods inherited from Base

inheritable=, inheritable?, #inheritable?, inherited

Constructor Details

#initialize(container_klass) ⇒ 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.

Parameters:

Raises:

  • (SmartCore::ArgumentError)

Since:

  • 0.1.0



15
16
17
18
19
20
21
22
# File 'lib/smart_core/container/definition_dsl/commands/instantiation/compose.rb', line 15

def initialize(container_klass)
  raise(
    SmartCore::ArgumentError,
    'Container class should be a subtype of Quantum::Container'
  ) unless container_klass < SmartCore::Container

  @container_klass = container_klass
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.

Parameters:

Since:

  • 0.1.0



29
30
31
32
33
34
35
# File 'lib/smart_core/container/definition_dsl/commands/instantiation/compose.rb', line 29

def call(registry)
  SmartCore::Container::RegistryBuilder.instantiate(
    container_klass, registry, ignored_commands: [
      SmartCore::Container::DefinitionDSL::Commands::Instantiation::FreezeState
    ]
  )
end

#dupSmartCore::Container::DefinitionDSL::Commands::Instantiation::Compose

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.



41
42
43
# File 'lib/smart_core/container/definition_dsl/commands/instantiation/compose.rb', line 41

def dup
  self.class.new(container_klass)
end