Class: CC::Analyzer::IssueValidator
- Inherits:
-
Object
- Object
- CC::Analyzer::IssueValidator
- Defined in:
- lib/cc/analyzer/issue_validator.rb
Constant Summary collapse
- CHECKS =
[ IssueCategoryValidation, IssueCheckNamePresenceValidation, IssueDescriptionPresenceValidation, IssueLocationFormatValidation, IssueOtherLocationsFormatValidation, IssuePathExistenceValidation, IssuePathIsFileValidation, IssuePathPresenceValidation, IssueRelativePathValidation, IssueTypeValidation, ].freeze
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
Instance Method Summary collapse
-
#initialize(issue) ⇒ IssueValidator
constructor
A new instance of IssueValidator.
- #validate ⇒ Object (also: #valid?)
Constructor Details
#initialize(issue) ⇒ IssueValidator
Returns a new instance of IssueValidator.
19 20 21 22 |
# File 'lib/cc/analyzer/issue_validator.rb', line 19 def initialize(issue) @issue = issue validate end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
17 18 19 |
# File 'lib/cc/analyzer/issue_validator.rb', line 17 def error @error end |
Instance Method Details
#validate ⇒ Object Also known as: valid?
24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/cc/analyzer/issue_validator.rb', line 24 def validate return @valid unless @valid.nil? if issue && .any? @error = { message: "#{.join("; ")}: `#{issue}`.", issue: issue, } @valid = false else @valid = true end end |