Class: Gitlab::Experiment::Nestable::Stack

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/gitlab/experiment/nestable.rb

Instance Method Summary collapse

Constructor Details

#initializeStack

Returns a new instance of Stack.



34
35
36
# File 'lib/gitlab/experiment/nestable.rb', line 34

def initialize
  @thread_key = "#{self.class};#{object_id}".to_sym
end

Instance Method Details

#push(instance) ⇒ Object



38
39
40
41
# File 'lib/gitlab/experiment/nestable.rb', line 38

def push(instance)
  stack.last&.nest_experiment(instance)
  stack.push(instance)
end