Class: Precheck::RuleCheckResult

Inherits:
Object
  • Object
show all
Defined in:
precheck/lib/precheck/rule_check_result.rb

Overview

after each item is checked for rule conformance to a single rule, a result is generated a result can have a status of success or fail for a given rule/item

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(item, rule_return, rule) ⇒ RuleCheckResult

Returns a new instance of RuleCheckResult.


9
10
11
12
13
# File 'precheck/lib/precheck/rule_check_result.rb', line 9

def initialize(item, rule_return, rule)
  @item = item
  @rule_return = rule_return
  @rule = rule
end

Instance Attribute Details

#itemObject

Returns the value of attribute item


5
6
7
# File 'precheck/lib/precheck/rule_check_result.rb', line 5

def item
  @item
end

#ruleObject

Returns the value of attribute rule


7
8
9
# File 'precheck/lib/precheck/rule_check_result.rb', line 7

def rule
  @rule
end

#rule_returnObject

RuleReturn


6
7
8
# File 'precheck/lib/precheck/rule_check_result.rb', line 6

def rule_return
  @rule_return
end

Instance Method Details

#statusObject


15
16
17
# File 'precheck/lib/precheck/rule_check_result.rb', line 15

def status
  rule_return.validation_state
end