Class: Qonfig::Validator Private
- Inherits:
-
Object
- Object
- Qonfig::Validator
- Defined in:
- lib/qonfig/validator.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
Modules: DSL, Predefined Classes: Basic, Builder, Collection, MethodBased, ProcBased
Instance Method Summary collapse
- #initialize(data_set) ⇒ void constructor private
- #valid? ⇒ Boolean private
- #validate! ⇒ void private
Constructor Details
#initialize(data_set) ⇒ 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.
19 20 21 22 |
# File 'lib/qonfig/validator.rb', line 19 def initialize(data_set) @data_set = data_set @validators = data_set.class.validators.dup end |
Instance Method Details
#valid? ⇒ Boolean
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.
38 39 40 41 42 43 |
# File 'lib/qonfig/validator.rb', line 38 def valid? validate! true rescue Qonfig::ValidationError false end |
#validate! ⇒ 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.
28 29 30 31 32 |
# File 'lib/qonfig/validator.rb', line 28 def validate! validators.each do |validator| validator.validate(data_set) end end |