Class: Precheck::RuleProcessResult
- Inherits:
-
Object
- Object
- Precheck::RuleProcessResult
- Defined in:
- precheck/lib/precheck/rule_processor.rb
Overview
encapsulated the results of the rule processing, needed to return not just an array of the results of our checks, but also an array of items we didn’t check, just in-case we were expecting to check everything
Instance Attribute Summary collapse
-
#error_results ⇒ Object
{ rule: [result, result, …] }.
-
#items_not_checked ⇒ Object
Returns the value of attribute items_not_checked.
-
#skipped_rules ⇒ Object
Returns the value of attribute skipped_rules.
-
#warning_results ⇒ Object
{ rule: [result, result, …] }.
Instance Method Summary collapse
- #has_errors_or_warnings? ⇒ Boolean
-
#initialize(error_results: nil, warning_results: nil, skipped_rules: nil, items_not_checked: nil) ⇒ RuleProcessResult
constructor
A new instance of RuleProcessResult.
- #items_not_checked? ⇒ Boolean
- #should_trigger_user_error? ⇒ Boolean
Constructor Details
#initialize(error_results: nil, warning_results: nil, skipped_rules: nil, items_not_checked: nil) ⇒ RuleProcessResult
Returns a new instance of RuleProcessResult.
18 19 20 21 22 23 24 25 26 |
# File 'precheck/lib/precheck/rule_processor.rb', line 18 def initialize(error_results: nil, warning_results: nil, skipped_rules: nil, items_not_checked: nil) @error_results = error_results @warning_results = warning_results @skipped_rules = skipped_rules @items_not_checked = items_not_checked end |
Instance Attribute Details
#error_results ⇒ Object
{ rule: [result, result, …] }
13 14 15 |
# File 'precheck/lib/precheck/rule_processor.rb', line 13 def error_results @error_results end |
#items_not_checked ⇒ Object
Returns the value of attribute items_not_checked.
16 17 18 |
# File 'precheck/lib/precheck/rule_processor.rb', line 16 def items_not_checked @items_not_checked end |
#skipped_rules ⇒ Object
Returns the value of attribute skipped_rules.
15 16 17 |
# File 'precheck/lib/precheck/rule_processor.rb', line 15 def skipped_rules @skipped_rules end |
#warning_results ⇒ Object
{ rule: [result, result, …] }
14 15 16 |
# File 'precheck/lib/precheck/rule_processor.rb', line 14 def warning_results @warning_results end |
Instance Method Details
#has_errors_or_warnings? ⇒ Boolean
33 34 35 36 |
# File 'precheck/lib/precheck/rule_processor.rb', line 33 def has_errors_or_warnings? return true if error_results.length > 0 || warning_results.length > 0 return false end |
#items_not_checked? ⇒ Boolean
38 39 40 41 |
# File 'precheck/lib/precheck/rule_processor.rb', line 38 def items_not_checked? return true if items_not_checked.length > 0 return false end |
#should_trigger_user_error? ⇒ Boolean
28 29 30 31 |
# File 'precheck/lib/precheck/rule_processor.rb', line 28 def should_trigger_user_error? return true if error_results.length > 0 return false end |