Class: Diogenes::Evaluation::DecisionRecord::RenderContext
- Inherits:
-
Object
- Object
- Diogenes::Evaluation::DecisionRecord::RenderContext
- Defined in:
- lib/diogenes/evaluation/decision_record.rb
Instance Attribute Summary collapse
-
#alternative ⇒ Object
readonly
Returns the value of attribute alternative.
-
#conditions ⇒ Object
readonly
Returns the value of attribute conditions.
-
#evaluator ⇒ Object
readonly
Returns the value of attribute evaluator.
-
#feature_name ⇒ Object
readonly
Returns the value of attribute feature_name.
-
#notes ⇒ Object
readonly
Returns the value of attribute notes.
-
#verdict ⇒ Object
readonly
Returns the value of attribute verdict.
Instance Method Summary collapse
- #feature_slug ⇒ Object
-
#gate_reason(key) ⇒ Object
: (Symbol) -> String.
-
#gate_result(key) ⇒ Object
: (Symbol) -> String.
- #get_binding ⇒ Object
-
#initialize(feature_name:, evaluator:, verdict:, results:, alternative:, conditions:, notes:) ⇒ RenderContext
constructor
: (feature_name: String, evaluator: String, verdict: String, results: Array, alternative: String, conditions: String, notes: String) -> void.
Constructor Details
#initialize(feature_name:, evaluator:, verdict:, results:, alternative:, conditions:, notes:) ⇒ RenderContext
: (feature_name: String, evaluator: String, verdict: String, results: Array, alternative: String, conditions: String, notes: String) -> void
81 82 83 84 85 86 87 88 89 |
# File 'lib/diogenes/evaluation/decision_record.rb', line 81 def initialize(feature_name:, evaluator:, verdict:, results:, alternative:, conditions:, notes:) @feature_name = feature_name @evaluator = evaluator @verdict = verdict @results = results @alternative = alternative @conditions = conditions @notes = notes end |
Instance Attribute Details
#alternative ⇒ Object (readonly)
Returns the value of attribute alternative.
95 96 97 |
# File 'lib/diogenes/evaluation/decision_record.rb', line 95 def alternative @alternative end |
#conditions ⇒ Object (readonly)
Returns the value of attribute conditions.
96 97 98 |
# File 'lib/diogenes/evaluation/decision_record.rb', line 96 def conditions @conditions end |
#evaluator ⇒ Object (readonly)
Returns the value of attribute evaluator.
93 94 95 |
# File 'lib/diogenes/evaluation/decision_record.rb', line 93 def evaluator @evaluator end |
#feature_name ⇒ Object (readonly)
Returns the value of attribute feature_name.
91 92 93 |
# File 'lib/diogenes/evaluation/decision_record.rb', line 91 def feature_name @feature_name end |
#notes ⇒ Object (readonly)
Returns the value of attribute notes.
97 98 99 |
# File 'lib/diogenes/evaluation/decision_record.rb', line 97 def notes @notes end |
#verdict ⇒ Object (readonly)
Returns the value of attribute verdict.
94 95 96 |
# File 'lib/diogenes/evaluation/decision_record.rb', line 94 def verdict @verdict end |
Instance Method Details
#feature_slug ⇒ Object
92 |
# File 'lib/diogenes/evaluation/decision_record.rb', line 92 def feature_slug = @feature_name.strip.downcase.gsub(/[^a-z0-9]+/, "_").gsub(/\A_+|_+\z/, "") |
#gate_reason(key) ⇒ Object
: (Symbol) -> String
107 108 109 110 111 |
# File 'lib/diogenes/evaluation/decision_record.rb', line 107 def gate_reason(key) r = @results.find { |res| res.gate.key == key } return "not evaluated" unless r r.passed? ? "Confirmed" : "Not confirmed" end |
#gate_result(key) ⇒ Object
: (Symbol) -> String
100 101 102 103 104 |
# File 'lib/diogenes/evaluation/decision_record.rb', line 100 def gate_result(key) r = @results.find { |res| res.gate.key == key } return "not evaluated" unless r r.passed? ? "PASS" : "FAIL" end |
#get_binding ⇒ Object
113 |
# File 'lib/diogenes/evaluation/decision_record.rb', line 113 def get_binding = binding |