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.
130 131 132 133 134 135 136 137 138 |
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 130 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)
143 144 145 |
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 143 def data @data end |
#kind ⇒ String (readonly)
141 142 143 |
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 141 def kind @kind end |
#match_result ⇒ LaunchDarkly::EvaluationDetail (readonly)
149 150 151 |
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 149 def match_result @match_result end |
#values ⇒ Set (readonly)
145 146 147 |
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 145 def values @values end |
#variation ⇒ Integer (readonly)
147 148 149 |
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 147 def variation @variation end |