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

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

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Since:

  • 5.5.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Target.

Since:

  • 5.5.0



174
175
176
177
178
179
180
181
182
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 174

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)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Hash)

Since:

  • 5.5.0



187
188
189
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 187

def data
  @data
end

#kind ⇒ String (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (String)

Since:

  • 5.5.0



185
186
187
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 185

def kind
  @kind
end

#match_result ⇒ LaunchDarkly::EvaluationDetail (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

Since:

  • 5.5.0



193
194
195
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 193

def match_result
  @match_result
end

#values ⇒ Set (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Set)

Since:

  • 5.5.0



189
190
191
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 189

def values
  @values
end

#variation ⇒ Integer (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Integer)

Since:

  • 5.5.0



191
192
193
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 191

def variation
  @variation
end