Class: LaunchDarkly::Impl::EvaluatorState
- Inherits:
-
Object
- Object
- LaunchDarkly::Impl::EvaluatorState
- Defined in:
- lib/ldclient-rb/impl/evaluator.rb
Overview
Instance Attribute Summary collapse
- #depth ⇒ Object
- #prereq_stack ⇒ Object readonly
- #prerequisites ⇒ Object readonly
- #segment_stack ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(original_flag) ⇒ EvaluatorState
constructor
A new instance of EvaluatorState.
- #record_evaluated_prereq_key(key) ⇒ Object
Constructor Details
#initialize(original_flag) ⇒ EvaluatorState
Returns a new instance of EvaluatorState.
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
#depth ⇒ Object
43 44 45 |
# File 'lib/ldclient-rb/impl/evaluator.rb', line 43 def depth @depth end |
#prereq_stack ⇒ Object (readonly)
45 46 47 |
# File 'lib/ldclient-rb/impl/evaluator.rb', line 45 def prereq_stack @prereq_stack end |
#prerequisites ⇒ Object (readonly)
44 45 46 |
# File 'lib/ldclient-rb/impl/evaluator.rb', line 44 def prerequisites @prerequisites end |
#segment_stack ⇒ Object (readonly)
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
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 |