Class: Toggly::EvaluationResult
- Inherits:
-
Object
- Object
- Toggly::EvaluationResult
- Defined in:
- lib/toggly/evaluation_engine.rb
Overview
Result of a feature evaluation with details
Instance Attribute Summary collapse
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#feature_key ⇒ Object
Returns the value of attribute feature_key.
-
#matched_rule ⇒ Object
Returns the value of attribute matched_rule.
-
#matched_rule_index ⇒ Object
Returns the value of attribute matched_rule_index.
-
#reason ⇒ Object
Returns the value of attribute reason.
Instance Method Summary collapse
-
#initialize(feature_key:, enabled:, reason:) ⇒ EvaluationResult
constructor
A new instance of EvaluationResult.
- #to_h ⇒ Object
Constructor Details
#initialize(feature_key:, enabled:, reason:) ⇒ EvaluationResult
Returns a new instance of EvaluationResult.
161 162 163 164 165 166 167 |
# File 'lib/toggly/evaluation_engine.rb', line 161 def initialize(feature_key:, enabled:, reason:) @feature_key = feature_key @enabled = enabled @reason = reason @matched_rule = nil @matched_rule_index = nil end |
Instance Attribute Details
#enabled ⇒ Object
Returns the value of attribute enabled.
159 160 161 |
# File 'lib/toggly/evaluation_engine.rb', line 159 def enabled @enabled end |
#feature_key ⇒ Object
Returns the value of attribute feature_key.
159 160 161 |
# File 'lib/toggly/evaluation_engine.rb', line 159 def feature_key @feature_key end |
#matched_rule ⇒ Object
Returns the value of attribute matched_rule.
159 160 161 |
# File 'lib/toggly/evaluation_engine.rb', line 159 def matched_rule @matched_rule end |
#matched_rule_index ⇒ Object
Returns the value of attribute matched_rule_index.
159 160 161 |
# File 'lib/toggly/evaluation_engine.rb', line 159 def matched_rule_index @matched_rule_index end |
#reason ⇒ Object
Returns the value of attribute reason.
159 160 161 |
# File 'lib/toggly/evaluation_engine.rb', line 159 def reason @reason end |
Instance Method Details
#to_h ⇒ Object
169 170 171 172 173 174 175 176 177 |
# File 'lib/toggly/evaluation_engine.rb', line 169 def to_h { feature_key: @feature_key, enabled: @enabled, reason: @reason, matched_rule: @matched_rule, matched_rule_index: @matched_rule_index } end |