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.
141 142 143 144 145 146 147 148 149 |
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 141 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)
154 155 156 |
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 154 def data @data end |
#kind ⇒ String (readonly)
152 153 154 |
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 152 def kind @kind end |
#match_result ⇒ LaunchDarkly::EvaluationDetail (readonly)
160 161 162 |
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 160 def match_result @match_result end |
#values ⇒ Set (readonly)
156 157 158 |
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 156 def values @values end |
#variation ⇒ Integer (readonly)
158 159 160 |
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 158 def variation @variation end |