Class: LaunchDarkly::Impl::EvaluatorState Private

Inherits:
Object
  • Object
show all
Defined in:
lib/ldclient-rb/impl/evaluator.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(original_flag) ⇒ EvaluatorState

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 EvaluatorState.

Parameters:

Since:

  • 5.5.0



34
35
36
37
38
39
40
41
42
# File 'lib/ldclient-rb/impl/evaluator.rb', line 34

def initialize(original_flag)
  @prereq_stack = EvaluatorStack.new(original_flag.key)
  @segment_stack = EvaluatorStack.new(nil)
  @prerequisites = []
  @depth = 0
  # Reading the flag's own definition is the first read of the evaluation, so the marking
  # starts from the flag's override marker.
  @override_affected = original_flag.override?
end

Instance Attribute Details

#depth ⇒ Object

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.

Since:

  • 5.5.0



48
49
50
# File 'lib/ldclient-rb/impl/evaluator.rb', line 48

def depth
  @depth
end

#override_affected ⇒ Object

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.

True if the evaluation in progress has read a definition that carries the override marker. While a prerequisite is evaluated, this holds the marking of the prerequisite's own subtree. The marking propagates upward only.

Since:

  • 5.5.0



55
56
57
# File 'lib/ldclient-rb/impl/evaluator.rb', line 55

def override_affected
  @override_affected
end

#prereq_stack ⇒ Object (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.

Since:

  • 5.5.0



50
51
52
# File 'lib/ldclient-rb/impl/evaluator.rb', line 50

def prereq_stack
  @prereq_stack
end

#prerequisites ⇒ Object (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.

Since:

  • 5.5.0



49
50
51
# File 'lib/ldclient-rb/impl/evaluator.rb', line 49

def prerequisites
  @prerequisites
end

#segment_stack ⇒ Object (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.

Since:

  • 5.5.0



51
52
53
# File 'lib/ldclient-rb/impl/evaluator.rb', line 51

def segment_stack
  @segment_stack
end

Instance Method Details

#record_evaluated_prereq_key(key) ⇒ Object

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.

Since:

  • 5.5.0



44
45
46
# File 'lib/ldclient-rb/impl/evaluator.rb', line 44

def record_evaluated_prereq_key(key)
  @prerequisites.push(key) if @depth.zero?
end