Sha256: 9568ecc894a2dcbb3aa461187531cc52ae57bfebbafe9c66c8489ca9537dd1c3

Contents?: true

Size: 859 Bytes

Versions: 4

Compression:

Stored size: 859 Bytes

Contents

# frozen_string_literal: true

module ConvenientService
  module Support
    module DependencyContainer
      module Commands
        class AssertValidContainer < Support::Command
          ##
          # @!attribute [r] container
          #   @return [Module]
          #
          attr_reader :container

          ##
          # @param container [Module]
          # @return [void]
          #
          def initialize(container:)
            @container = container
          end

          ##
          # @return [void]
          # @raise [ConvenientService::Support::DependencyContainer::Exceptions::NotExportableModule]
          #
          def call
            raise Exceptions::NotExportableModule.new(mod: container) unless Utils::Module.include_module?(container, DependencyContainer::Export)
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
convenient_service-0.16.0 lib/convenient_service/support/dependency_container/commands/assert_valid_container.rb
convenient_service-0.15.0 lib/convenient_service/support/dependency_container/commands/assert_valid_container.rb
convenient_service-0.14.0 lib/convenient_service/support/dependency_container/commands/assert_valid_container.rb
convenient_service-0.13.0 lib/convenient_service/support/dependency_container/commands/assert_valid_container.rb