Class: LaunchDarkly::Impl::Model::Target
- Inherits:
-
Object
- Object
- LaunchDarkly::Impl::Model::Target
- Defined in:
- lib/ldclient-rb/impl/model/feature_flag.rb
Overview
Instance Attribute Summary collapse
- #data ⇒ Hash readonly
- #kind ⇒ String readonly
- #match_result ⇒ LaunchDarkly::EvaluationDetail readonly
- #values ⇒ Set readonly
- #variation ⇒ Integer readonly
Instance Method Summary collapse
-
#initialize(data, flag, errors_out = nil) ⇒ Target
constructor
A new instance of Target.
Constructor Details
#initialize(data, flag, errors_out = nil) ⇒ Target
Returns a new instance of Target.
140 141 142 143 144 145 146 147 148 |
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 140 def initialize(data, flag, errors_out = nil) @kind = data[:contextKind] || LDContext::KIND_DEFAULT @data = data @values = Set.new(data[:values] || []) @variation = data[:variation] @match_result = EvaluatorHelpers.evaluation_detail_for_variation(flag, data[:variation], EvaluationReason::target_match) check_variation_range(flag, errors_out, @variation, "target") end |
Instance Attribute Details
#data ⇒ Hash (readonly)
153 154 155 |
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 153 def data @data end |
#kind ⇒ String (readonly)
151 152 153 |
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 151 def kind @kind end |
#match_result ⇒ LaunchDarkly::EvaluationDetail (readonly)
159 160 161 |
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 159 def match_result @match_result end |
#values ⇒ Set (readonly)
155 156 157 |
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 155 def values @values end |
#variation ⇒ Integer (readonly)
157 158 159 |
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 157 def variation @variation end |