Class: LaunchDarkly::Impl::EvaluatorState

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

Overview

Since:

  • 5.5.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(original_flag) ⇒ EvaluatorState

Returns a new instance of EvaluatorState.

Parameters:

Since:

  • 5.5.0



32
33
34
35
36
37
# File 'lib/ldclient-rb/impl/evaluator.rb', line 32

def initialize(original_flag)
  @prereq_stack = EvaluatorStack.new(original_flag.key)
  @segment_stack = EvaluatorStack.new(nil)
  @prerequisites = []
  @depth = 0
end

Instance Attribute Details

#depthObject

Since:

  • 5.5.0



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

def depth
  @depth
end

#prereq_stackObject (readonly)

Since:

  • 5.5.0



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

def prereq_stack
  @prereq_stack
end

#prerequisitesObject (readonly)

Since:

  • 5.5.0



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

def prerequisites
  @prerequisites
end

#segment_stackObject (readonly)

Since:

  • 5.5.0



46
47
48
# File 'lib/ldclient-rb/impl/evaluator.rb', line 46

def segment_stack
  @segment_stack
end

Instance Method Details

#record_evaluated_prereq_key(key) ⇒ Object

Since:

  • 5.5.0



39
40
41
# File 'lib/ldclient-rb/impl/evaluator.rb', line 39

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