Class: Precheck::Rule::RuleReturn

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_dataObject

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_stateObject

Returns the value of attribute validation_state.



31
32
33
# File 'precheck/lib/precheck/rule.rb', line 31

def validation_state
  @validation_state
end