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, 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.
18 19 20 21 |
# File 'lib/cc/analyzer/issue_validator.rb', line 18 def initialize(issue) @issue = issue validate end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
16 17 18 |
# File 'lib/cc/analyzer/issue_validator.rb', line 16 def error @error end |
Instance Method Details
#validate ⇒ Object Also known as: valid?
23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/cc/analyzer/issue_validator.rb', line 23 def validate return @valid unless @valid.nil? if issue && .any? @error = { message: "#{invalid_messages.join("; ")}: `#{issue}`.", issue: issue, } @valid = false else @valid = true end end |