Class: SmartCore::Initializer::Extensions::List Private
- Inherits:
-
Object
- Object
- SmartCore::Initializer::Extensions::List
- Includes:
- Enumerable
- Defined in:
- lib/smart_core/initializer/extensions/list.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.
Instance Method Summary collapse
- #add(extension) ⇒ void (also: #<<) private
- #concat(list) ⇒ void private
- #each(&block) ⇒ Enumerable private
- #initialize ⇒ void constructor private
- #size ⇒ Integer 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 |
# File 'lib/smart_core/initializer/extensions/list.rb', line 15 def initialize @extensions = [] @lock = SmartCore::Engine::ReadWriteLock.new end |
Instance Method Details
#add(extension) ⇒ 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/initializer/extensions/list.rb', line 26 def add(extension) @lock.write_sync { extensions << extension } end |
#concat(list) ⇒ 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.
37 38 39 40 41 |
# File 'lib/smart_core/initializer/extensions/list.rb', line 37 def concat(list) @lock.write_sync do list.each { |extension| add(extension.dup) } end end |
#each(&block) ⇒ Enumerable
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 52 53 |
# File 'lib/smart_core/initializer/extensions/list.rb', line 49 def each(&block) @lock.read_sync do block_given? ? extensions.each(&block) : extensions.each end end |
#size ⇒ Integer
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/initializer/extensions/list.rb', line 60 def size @lock.read_sync { extensions.size } end |