Sha256: 375404e0de0c667c909a8fdace36646c0351d1e7ad17cf15575088b5295a8b49

Contents?: true

Size: 1.16 KB

Versions: 11

Compression:

Stored size: 1.16 KB

Contents

# frozen_string_literal: true

module SmartCore::Container::DefinitionDSL::Commands::Definition
  # @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.define(container_klass, registry)
    end

    # @return [SmartCore::Container::DefinitionDSL::Commands::Definition::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

Version Path
smart_container-0.11.0 lib/smart_core/container/definition_dsl/commands/definition/compose.rb
smart_container-0.10.0 lib/smart_core/container/definition_dsl/commands/definition/compose.rb
smart_container-0.9.0 lib/smart_core/container/definition_dsl/commands/definition/compose.rb
smart_container-0.8.1 lib/smart_core/container/definition_dsl/commands/definition/compose.rb
smart_container-0.8.0 lib/smart_core/container/definition_dsl/commands/definition/compose.rb
smart_container-0.7.0 lib/smart_core/container/definition_dsl/commands/definition/compose.rb
smart_container-0.6.0 lib/smart_core/container/definition_dsl/commands/definition/compose.rb
smart_container-0.5.0 lib/smart_core/container/definition_dsl/commands/definition/compose.rb
smart_container-0.4.0 lib/smart_core/container/definition_dsl/commands/definition/compose.rb
smart_container-0.3.0 lib/smart_core/container/definition_dsl/commands/definition/compose.rb
smart_container-0.2.0 lib/smart_core/container/definition_dsl/commands/definition/compose.rb