Class: Qonfig::Validation::Collections::PredefinedRegistry Private
- Inherits:
-
Object
- Object
- Qonfig::Validation::Collections::PredefinedRegistry
- Includes:
- Enumerable
- Defined in:
- lib/qonfig/validation/collections/predefined_registry.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
- #dup ⇒ Qonfig::Validation::Collection::PredefinedRegistry private
- #each(&block) {|validator_name, validation_logic| ... } ⇒ Enumerable private
- #initialize ⇒ void constructor private
- #merge(predefined_registry) ⇒ void private
- #register(name, validation) ⇒ void (also: #[]=) private
- #resolve(name) ⇒ Proc (also: #[]) 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.
13 14 15 16 |
# File 'lib/qonfig/validation/collections/predefined_registry.rb', line 13 def initialize @validators = {} @lock = Mutex.new end |
Instance Method Details
#dup ⇒ Qonfig::Validation::Collection::PredefinedRegistry
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.
52 53 54 |
# File 'lib/qonfig/validation/collections/predefined_registry.rb', line 52 def dup thread_safe { duplicate } end |
#each(&block) {|validator_name, validation_logic| ... } ⇒ 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.
64 65 66 67 68 |
# File 'lib/qonfig/validation/collections/predefined_registry.rb', line 64 def each(&block) thread_safe do block_given? ? validators.each_pair(&block) : validators.each_pair end end |
#merge(predefined_registry) ⇒ 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.
23 24 25 |
# File 'lib/qonfig/validation/collections/predefined_registry.rb', line 23 def merge(predefined_registry) thread_safe { concat(predefined_registry) } end |
#register(name, validation) ⇒ 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.
33 34 35 |
# File 'lib/qonfig/validation/collections/predefined_registry.rb', line 33 def register(name, validation) thread_safe { apply(name, validation) } end |
#resolve(name) ⇒ Proc 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.
43 44 45 |
# File 'lib/qonfig/validation/collections/predefined_registry.rb', line 43 def resolve(name) thread_safe { fetch(name) } end |