Class: CC::Config::Validation::EngineValidator
- Inherits:
-
Object
- Object
- CC::Config::Validation::EngineValidator
- Includes:
- HashValidations
- Defined in:
- lib/cc/config/validation/engine_validator.rb
Constant Summary collapse
- RECOGNIZED_KEYS =
%w[ enabled channel checks config exclude_fingerprints exclude_patterns ].freeze
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#warnings ⇒ Object
readonly
Returns the value of attribute warnings.
Instance Method Summary collapse
-
#initialize(data, legacy: false) ⇒ EngineValidator
constructor
A new instance of EngineValidator.
- #valid? ⇒ Boolean
Methods included from HashValidations
#key_type_error_message, #validate_hash_data, #validate_key_type, #warn_unrecognized_keys
Constructor Details
#initialize(data, legacy: false) ⇒ EngineValidator
Returns a new instance of EngineValidator.
18 19 20 21 22 23 24 25 26 |
# File 'lib/cc/config/validation/engine_validator.rb', line 18 def initialize(data, legacy: false) @data = data @legacy = legacy @errors = [] @warnings = [] validate end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
16 17 18 |
# File 'lib/cc/config/validation/engine_validator.rb', line 16 def errors @errors end |
#warnings ⇒ Object (readonly)
Returns the value of attribute warnings.
16 17 18 |
# File 'lib/cc/config/validation/engine_validator.rb', line 16 def warnings @warnings end |
Instance Method Details
#valid? ⇒ Boolean
28 29 30 |
# File 'lib/cc/config/validation/engine_validator.rb', line 28 def valid? errors.none? end |