Class: SmartCore::Container::DependencyCompatability::Registry Private

Inherits:
Abstract
  • Object
show all
Defined in:
lib/smart_core/container/dependency_compatability/registry.rb

Overview

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

Since:

  • 0.5.0

Class Method Summary collapse

Methods inherited from Abstract

prevent_dependency_overlap!, prevent_namespace_overlap!

Class Method Details

.potential_dependency_overlap?(registry, 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:

  • registry (SmartCore::Container::Regsitry)
  • namespace_name (String)

Returns:

  • (Boolean)

Since:

  • 0.5.0



28
29
30
31
32
33
34
# File 'lib/smart_core/container/dependency_compatability/registry.rb', line 28

def potential_dependency_overlap?(registry, namespace_name)
  registry.any? do |registered_dependency|
    next unless registered_dependency.is_a?(SmartCore::Container::Dependency)
    # NOTE: registered_dependency is a dependency/memoized dependency
    registered_dependency.external_name == namespace_name
  end
end

.potential_namespace_overlap?(registry, 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:

  • registry (SmartCore::Container::Regsitry)
  • dependency_name (String)

Returns:

  • (Boolean)

Since:

  • 0.5.0



14
15
16
17
18
19
20
# File 'lib/smart_core/container/dependency_compatability/registry.rb', line 14

def potential_namespace_overlap?(registry, dependency_name)
  registry.any? do |registered_dependency|
    next unless registered_dependency.is_a?(SmartCore::Container::Namespace)
    # NOTE: registered_dependency is a namespace
    registered_dependency.external_name == dependency_name
  end
end