Class: LaunchDarkly::Impl::Model::Target

Inherits:
Object
  • Object
show all
Defined in:
lib/ldclient-rb/impl/model/feature_flag.rb

Overview

Since:

  • 5.5.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, flag, errors_out = nil) ⇒ Target

Returns a new instance of Target.

Since:

  • 5.5.0



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

#dataHash (readonly)

Returns:

  • (Hash)

Since:

  • 5.5.0



153
154
155
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 153

def data
  @data
end

#kindString (readonly)

Returns:

  • (String)

Since:

  • 5.5.0



151
152
153
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 151

def kind
  @kind
end

#match_resultLaunchDarkly::EvaluationDetail (readonly)

Returns:

Since:

  • 5.5.0



159
160
161
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 159

def match_result
  @match_result
end

#valuesSet (readonly)

Returns:

  • (Set)

Since:

  • 5.5.0



155
156
157
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 155

def values
  @values
end

#variationInteger (readonly)

Returns:

  • (Integer)

Since:

  • 5.5.0



157
158
159
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 157

def variation
  @variation
end