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