Module: Qonfig::Validator::DSL Private
- Included in:
- DataSet
- Defined in:
- lib/qonfig/validator/dsl.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Class Method Summary collapse
- .extended(child_klass) ⇒ void private
Instance Method Summary collapse
- #validate(setting_key_pattern = nil, predefined = nil, by: nil, &custom_validation) ⇒ void private
- #validators ⇒ Qonfig::Validator::Collection private
Class Method Details
.extended(child_klass) ⇒ 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.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/qonfig/validator/dsl.rb', line 12 def extended(child_klass) child_klass.instance_variable_set(:@validators, Qonfig::Validator::Collection.new) child_klass.singleton_class.prepend(Module.new do def inherited(child_klass) child_klass.instance_variable_set(:@validators, Qonfig::Validator::Collection.new) child_klass.validators.concat(validators) super end end) end |
Instance Method Details
#validate(setting_key_pattern = nil, predefined = nil, by: nil, &custom_validation) ⇒ 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.
43 44 45 46 47 48 49 50 |
# File 'lib/qonfig/validator/dsl.rb', line 43 def validate(setting_key_pattern = nil, predefined = nil, by: nil, &custom_validation) validators << Qonfig::Validator::Builder.build( setting_key_pattern: setting_key_pattern, predefined_validator: predefined, runtime_validation_method: by, validation_logic: custom_validation ) end |
#validators ⇒ Qonfig::Validator::Collection
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.
29 30 31 |
# File 'lib/qonfig/validator/dsl.rb', line 29 def validators @validators end |