Sha256: 7cc24567402eea9c93e746f41dcd63a54890ea6a2084af7f971400c66f0ffd2e
Contents?: true
Size: 1.3 KB
Versions: 11
Compression:
Stored size: 1.3 KB
Contents
# frozen_string_literal: true module SmartCore::Container::DefinitionDSL::Commands::Instantiation # @api private # @since 0.1.0 class Compose < SmartCore::Container::DefinitionDSL::Commands::Base # @since 0.1.0 self.inheritable = true # @param container_klass [Class<SmartCore::Container>] # @return [void] # # @api private # @since 0.1.0 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 # @param registry [SmartCore::Container::Registry] # @return [void] # # @api private # @since 0.1.0 def call(registry) SmartCore::Container::RegistryBuilder.instantiate( container_klass, registry, ignored_commands: [ SmartCore::Container::DefinitionDSL::Commands::Instantiation::FreezeState ] ) end # @return [SmartCore::Container::DefinitionDSL::Commands::Instantiation::Compose] # # @api private # @since 0.1.0 def dup self.class.new(container_klass) end private # @return [Class<SmartCore::Container>] # # @api private # @since 0.1.0 attr_reader :container_klass end end
Version data entries
11 entries across 11 versions & 1 rubygems