Class: LaunchDarkly::Impl::Model::EvalResultsForSingleVariation
- Inherits:
-
Object
- Object
- LaunchDarkly::Impl::Model::EvalResultsForSingleVariation
- Defined in:
- lib/ldclient-rb/impl/model/preprocessed_data.rb
Overview
Container for a precomputed result that includes a specific variation index and value, an evaluation reason, and optionally an alternate evaluation reason that corresponds to the “in experiment” state.
Instance Method Summary collapse
- #get_result(in_experiment = false) ⇒ LaunchDarkly::EvaluationDetail
-
#initialize(value, variation_index, regular_reason, in_experiment_reason = nil) ⇒ EvalResultsForSingleVariation
constructor
A new instance of EvalResultsForSingleVariation.
Constructor Details
#initialize(value, variation_index, regular_reason, in_experiment_reason = nil) ⇒ EvalResultsForSingleVariation
Returns a new instance of EvalResultsForSingleVariation.
12 13 14 15 16 17 |
# File 'lib/ldclient-rb/impl/model/preprocessed_data.rb', line 12 def initialize(value, variation_index, regular_reason, in_experiment_reason = nil) @regular_result = EvaluationDetail.new(value, variation_index, regular_reason) @in_experiment_result = in_experiment_reason ? EvaluationDetail.new(value, variation_index, in_experiment_reason) : @regular_result end |
Instance Method Details
#get_result(in_experiment = false) ⇒ LaunchDarkly::EvaluationDetail
22 23 24 |
# File 'lib/ldclient-rb/impl/model/preprocessed_data.rb', line 22 def get_result(in_experiment = false) in_experiment ? @in_experiment_result : @regular_result end |