Class: SmartCore::Injection::Injector::ContainerSet Private
- Inherits:
-
Object
- Object
- SmartCore::Injection::Injector::ContainerSet
- Includes:
- Enumerable
- Defined in:
- lib/smart_core/injection/injector/container_set.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.
Defined Under Namespace
Classes: AddingListener
Instance Method Summary collapse
- #add(container) ⇒ void (also: #<<) private
- #each(&block) {|container| ... } ⇒ Enumerator private
- #initialize ⇒ void constructor private
- #list ⇒ Array<SmartCore::Container> private
- #listen_addings(&listener) {|container| ... } ⇒ void private
- #reverse_each(&block) {|container| ... } ⇒ Enumerator private
Constructor Details
#initialize ⇒ 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.
15 16 17 18 19 |
# File 'lib/smart_core/injection/injector/container_set.rb', line 15 def initialize @containers = [] # NOTE: we use Array cuz we need an ordered set @adding_listeners = [] @access_lock = SmartCore::Engine::Lock.new end |
Instance Method Details
#add(container) ⇒ void Also known as: <<
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.
26 27 28 |
# File 'lib/smart_core/injection/injector/container_set.rb', line 26 def add(container) thread_safe { append_container(container) } end |
#each(&block) {|container| ... } ⇒ Enumerator
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.
49 50 51 |
# File 'lib/smart_core/injection/injector/container_set.rb', line 49 def each(&block) thread_safe { block_given? ? containers.each(&block) : containers.each } end |
#list ⇒ Array<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.
68 69 70 |
# File 'lib/smart_core/injection/injector/container_set.rb', line 68 def list thread_safe { containers.dup } end |
#listen_addings(&listener) {|container| ... } ⇒ 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.
38 39 40 |
# File 'lib/smart_core/injection/injector/container_set.rb', line 38 def listen_addings(&listener) thread_safe { add_adding_listener(listener) } end |
#reverse_each(&block) {|container| ... } ⇒ Enumerator
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.
60 61 62 |
# File 'lib/smart_core/injection/injector/container_set.rb', line 60 def reverse_each(&block) thread_safe { block_given? ? containers.reverse_each(&block) : containers.reverse_each } end |