Sha256: 9fa3b55854f38d007cabe6b2523d61296c17c8ac90975d72fbeb7e22ec840229

Contents?: true

Size: 1.15 KB

Versions: 11

Compression:

Stored size: 1.15 KB

Contents

# frozen_string_literal: true

# @api private
# @since 0.1.0
module SmartCore::Container::DependencyCompatability::Definition
  class << self
    # @since 0.1.0
    include SmartCore::Container::DependencyCompatability::General

    # @param container_klass [Class<SmartCore::Container>]
    # @param dependency_name [String, Symbol]
    # @return [Boolean]
    #
    # @api private
    # @since 0.1.0
    def potential_namespace_overlap?(container_klass, dependency_name)
      anonymous_container = Class.new(container_klass).new
      anonymous_container.register(dependency_name, &(proc {}))
      false
    rescue SmartCore::Container::DependencyOverNamespaceOverlapError
      true
    end

    # @param container_klass [Class<SmartCore::Container>]
    # @param namespace_name [String, Symbol]
    # @return [Boolean]
    #
    # @api private
    # @since 0.1.0
    def potential_dependency_overlap?(container_klass, namespace_name)
      anonymous_container = Class.new(container_klass).new
      anonymous_container.namespace(namespace_name, &(proc {}))
      false
    rescue SmartCore::Container::NamespaceOverDependencyOverlapError
      true
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
smart_container-0.11.0 lib/smart_core/container/dependency_compatability/definition.rb
smart_container-0.10.0 lib/smart_core/container/dependency_compatability/definition.rb
smart_container-0.8.1 lib/smart_core/container/dependency_compatability/definition.rb
smart_container-0.8.0 lib/smart_core/container/dependency_compatability/definition.rb
smart_container-0.7.0 lib/smart_core/container/dependency_compatability/definition.rb
smart_container-0.6.0 lib/smart_core/container/dependency_compatability/definition.rb
smart_container-0.5.0 lib/smart_core/container/dependency_compatability/definition.rb
smart_container-0.4.0 lib/smart_core/container/dependency_compatability/definition.rb
smart_container-0.3.0 lib/smart_core/container/dependency_compatability/definition.rb
smart_container-0.2.0 lib/smart_core/container/dependency_compatability/definition.rb
smart_container-0.1.0 lib/smart_core/container/dependency_compatability/definition.rb