Module: SmartCore::Container::DependencyCompatability::Definition Private

Extended by:
General
Defined in:
lib/smart_core/container/dependency_compatability/definition.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0

Class Method Summary collapse

Methods included from General

potential_dependency_overlap?, potential_namespace_overlap?, prevent_dependency_overlap!, prevent_namespace_overlap!

Class Method Details

.potential_dependency_overlap?(container_klass, namespace_name) ⇒ Boolean

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:

Returns:

  • (Boolean)

Since:

  • 0.1.0



30
31
32
33
34
35
36
# File 'lib/smart_core/container/dependency_compatability/definition.rb', line 30

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

.potential_namespace_overlap?(container_klass, dependency_name) ⇒ Boolean

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:

Returns:

  • (Boolean)

Since:

  • 0.1.0



16
17
18
19
20
21
22
# File 'lib/smart_core/container/dependency_compatability/definition.rb', line 16

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