Class: Precheck::Rule::RuleReturn
- Inherits:
-
Object
- Object
- Precheck::Rule::RuleReturn
- Defined in:
- precheck/lib/precheck/rule.rb
Overview
when a rule evaluates a single item, it has a validation state if it fails, it has some data like what text failed to pass, or maybe a bad url this class encapsulates that return value and state it is the return value from each evaluated @rule_block
Instance Attribute Summary collapse
-
#failure_data ⇒ Object
Returns the value of attribute failure_data.
-
#validation_state ⇒ Object
Returns the value of attribute validation_state.
Instance Method Summary collapse
-
#initialize(validation_state: nil, failure_data: nil) ⇒ RuleReturn
constructor
A new instance of RuleReturn.
Constructor Details
#initialize(validation_state: nil, failure_data: nil) ⇒ RuleReturn
Returns a new instance of RuleReturn.
34 35 36 37 |
# File 'precheck/lib/precheck/rule.rb', line 34 def initialize(validation_state: nil, failure_data: nil) @validation_state = validation_state @failure_data = failure_data end |
Instance Attribute Details
#failure_data ⇒ Object
Returns the value of attribute failure_data.
32 33 34 |
# File 'precheck/lib/precheck/rule.rb', line 32 def failure_data @failure_data end |
#validation_state ⇒ Object
Returns the value of attribute validation_state.
31 32 33 |
# File 'precheck/lib/precheck/rule.rb', line 31 def validation_state @validation_state end |