Class: Roast::Workflow::Validators::BaseValidator
- Inherits:
-
Object
- Object
- Roast::Workflow::Validators::BaseValidator
- Defined in:
- lib/roast/workflow/validators/base_validator.rb
Overview
Base class for all validators
Direct Known Subclasses
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(parsed_yaml, workflow_path = nil) ⇒ BaseValidator
constructor
A new instance of BaseValidator.
- #valid? ⇒ Boolean
- #validate ⇒ Object
Constructor Details
#initialize(parsed_yaml, workflow_path = nil) ⇒ BaseValidator
Returns a new instance of BaseValidator.
10 11 12 13 14 15 |
# File 'lib/roast/workflow/validators/base_validator.rb', line 10 def initialize(parsed_yaml, workflow_path = nil) @parsed_yaml = parsed_yaml @workflow_path = workflow_path @errors = [] @warnings = [] end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
8 9 10 |
# File 'lib/roast/workflow/validators/base_validator.rb', line 8 def errors @errors end |
#warnings ⇒ Object (readonly)
Returns the value of attribute warnings.
8 9 10 |
# File 'lib/roast/workflow/validators/base_validator.rb', line 8 def warnings @warnings end |
Instance Method Details
#valid? ⇒ Boolean
21 22 23 24 |
# File 'lib/roast/workflow/validators/base_validator.rb', line 21 def valid? validate @errors.empty? end |
#validate ⇒ Object
17 18 19 |
# File 'lib/roast/workflow/validators/base_validator.rb', line 17 def validate raise NotImplementedError, "Subclasses must implement validate" end |