Class: CC::Analyzer::IssueValidator
- Inherits:
-
Object
- Object
- CC::Analyzer::IssueValidator
- Defined in:
- lib/cc/analyzer/issue_validator.rb
Constant Summary collapse
- CHECKS =
IssueValidations.validations.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.
8 9 10 11 |
# File 'lib/cc/analyzer/issue_validator.rb', line 8 def initialize(issue) @issue = issue validate end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
6 7 8 |
# File 'lib/cc/analyzer/issue_validator.rb', line 6 def error @error end |
Instance Method Details
#validate ⇒ Object Also known as: valid?
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/cc/analyzer/issue_validator.rb', line 13 def validate return @valid unless @valid.nil? if issue && .any? @error = { message: "#{.join("; ")}: `#{issue}`.", issue: issue, } @valid = false else @valid = true end end |