Class: SmartCore::Container::DependencyCompatability::Abstract Private

Inherits:
Object
  • Object
show all
Defined in:
lib/smart_core/container/dependency_compatability/abstract.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

Direct Known Subclasses

CommandSet, Registry

Class Method Summary collapse

Class Method Details

.potential_dependency_overlap?(dependency_root, namespace) ⇒ 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:

  • dependency_root (Any)
  • namespace (Any)

Returns:

  • (Boolean)

Raises:

  • (NoMethodError)

Since:

  • 0.5.0



55
56
57
# File 'lib/smart_core/container/dependency_compatability/abstract.rb', line 55

def potential_dependency_overlap?(dependency_root, namespace)
  raise NoMethodError
end

.potential_namespace_overlap?(dependency_root, dependency) ⇒ 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:

  • dependency_root (Any)
  • dependency (Any)

Returns:

  • (Boolean)

Raises:

  • (NoMethodError)

Since:

  • 0.5.0



45
46
47
# File 'lib/smart_core/container/dependency_compatability/abstract.rb', line 45

def potential_namespace_overlap?(dependency_root, dependency)
  raise NoMethodError
end

.prevent_dependency_overlap!(dependency_root, namespace_name) ⇒ void

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.

This method returns an undefined value.

Parameters:

  • dependency_root (Any)
  • namespace_name (String)

Raises:

Since:

  • 0.5.0



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

def prevent_dependency_overlap!(dependency_root, namespace_name)
  raise(
    SmartCore::Container::DependencyOverlapError,
    "Trying to overlap already registered :#{namespace_name} " \
    "dependency with :#{namespace_name} namespace!"
  ) if potential_dependency_overlap?(dependency_root, namespace_name)
end

.prevent_namespace_overlap!(dependency_root, dependency_name) ⇒ void

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.

This method returns an undefined value.

Parameters:

  • dependency_root (Any)
  • dependency_name (String)

Raises:

Since:

  • 0.5.0



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

def prevent_namespace_overlap!(dependency_root, dependency_name)
  raise(
    SmartCore::Container::NamespaceOverlapError,
    "Trying to overlap already registered :#{dependency_name} " \
    "namespace with :#{dependency_name} dependency!"
  ) if potential_namespace_overlap?(dependency_root, dependency_name)
end