Module: CC::Analyzer::Validator
- Included in:
- IssueValidator, MeasurementValidator
- Defined in:
- lib/cc/analyzer/validator.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
Instance Method Summary collapse
- #initialize(document) ⇒ Object
- #validate ⇒ Object (also: #valid?)
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
4 5 6 |
# File 'lib/cc/analyzer/validator.rb', line 4 def error @error end |
Instance Method Details
#initialize(document) ⇒ Object
6 7 8 9 |
# File 'lib/cc/analyzer/validator.rb', line 6 def initialize(document) @document = document validate end |
#validate ⇒ Object Also known as: valid?
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/cc/analyzer/validator.rb', line 11 def validate return @valid unless @valid.nil? if document && .any? @error = { message: "#{.join("; ")}: `#{document}`.", document: document, } @valid = false else @valid = true end end |