Class: SmartCore::Injection::Injector Private

Inherits:
Object
  • Object
show all
Defined in:
lib/smart_core/injection/injector.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.1.0

Defined Under Namespace

Modules: Modulizer, Strategies Classes: ContainerSet, InjectionSettings

Instance Method Summary collapse

Constructor Details

#initialize(injectable) ⇒ 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.

Parameters:

  • injectable (Class, Module)

Since:

  • 0.1.0



16
17
18
19
20
# File 'lib/smart_core/injection/injector.rb', line 16

def initialize(injectable)
  @injectable = injectable
  @linked_containers = SmartCore::Injection::Injector::ContainerSet.new
  @access_lock = SmartCore::Engine::Lock.new
end

Instance Method Details

#associated_containersArray<SmartCore::Container>

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.

Returns:

  • (Array<SmartCore::Container>)

Since:

  • 0.1.0



61
62
63
# File 'lib/smart_core/injection/injector.rb', line 61

def associated_containers
  thread_safe { linked_containers.list }
end

#duplicate_for(another_injectable) ⇒ SmartCore::Injection::Injector

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:

  • another_injectable (Class, Module)

Returns:

Since:

  • 0.1.0



70
71
72
# File 'lib/smart_core/injection/injector.rb', line 70

def duplicate_for(another_injectable)
  thread_safe { create_duplicate(another_injectable) }
end

#inject(imports, memoize, access, bind, from) ⇒ 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:

  • imports (Hash<String|Symbol,String>)
  • memoize (Boolean)
  • access (Symbol)
  • bind (Symbol)
  • from (NilClass, SmartCore::Container)

Since:

  • 0.1.0



31
32
33
# File 'lib/smart_core/injection/injector.rb', line 31

def inject(imports, memoize, access, bind, from)
  thread_safe { inject_instance_method(imports, memoize, access, bind, from) }
end

#inject_static(imports, memoize, access, bind, from) ⇒ 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:

  • imports (Hash<String|Symbol,String>)
  • memoize (Boolean)
  • access (Symbol)
  • bind (Symbol)
  • from (NilClass, SmartCore::Container)

Since:

  • 0.1.0



44
45
46
# File 'lib/smart_core/injection/injector.rb', line 44

def inject_static(imports, memoize, access, bind, from)
  thread_safe { inject_class_method(imports, memoize, access, bind, from) }
end

#register_container(*containers) ⇒ 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:

  • containers (Array<SmartCore::Container>)

Since:

  • 0.1.0



53
54
55
# File 'lib/smart_core/injection/injector.rb', line 53

def register_container(*containers)
  thread_safe { link_container(containers) }
end