Class: Qonfig::Validation::Collections::InstanceCollection Private
- Inherits:
-
Object
- Object
- Qonfig::Validation::Collections::InstanceCollection
- Includes:
- Enumerable
- Defined in:
- lib/qonfig/validation/collections/instance_collection.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 Attribute Summary collapse
- #validators ⇒ Array<Qonfig::Validation::Validators::Base> readonly private
Instance Method Summary collapse
- #add_validator(validator) ⇒ void (also: #<<) private
- #concat(collection) ⇒ void private
- #dup ⇒ Qonfig::Validation::Collections::InstanceCollection private
- #each(&block) ⇒ Enumerable private
- #initialize ⇒ void constructor 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.
20 21 22 23 |
# File 'lib/qonfig/validation/collections/instance_collection.rb', line 20 def initialize @validators = [] @access_lock = Mutex.new end |
Instance Attribute Details
#validators ⇒ Array<Qonfig::Validation::Validators::Base> (readonly)
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.
14 15 16 |
# File 'lib/qonfig/validation/collections/instance_collection.rb', line 14 def validators @validators end |
Instance Method Details
#add_validator(validator) ⇒ 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.
30 31 32 |
# File 'lib/qonfig/validation/collections/instance_collection.rb', line 30 def add_validator(validator) thread_safe { validators << validator } end |
#concat(collection) ⇒ 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.
49 50 51 |
# File 'lib/qonfig/validation/collections/instance_collection.rb', line 49 def concat(collection) thread_safe { validators.concat(collection.validators) } end |
#dup ⇒ Qonfig::Validation::Collections::InstanceCollection
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.
57 58 59 60 61 62 63 |
# File 'lib/qonfig/validation/collections/instance_collection.rb', line 57 def dup thread_safe do Qonfig::Validation::Collections::InstanceCollection.new.tap do |duplicate| duplicate.concat(self) end 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.
40 41 42 |
# File 'lib/qonfig/validation/collections/instance_collection.rb', line 40 def each(&block) thread_safe { block_given? ? validators.each(&block) : validators.each } end |