Class: Gitlab::Experiment::Nestable::Stack
- Inherits:
-
Object
- Object
- Gitlab::Experiment::Nestable::Stack
- Includes:
- Singleton
- Defined in:
- lib/gitlab/experiment/nestable.rb
Instance Method Summary collapse
-
#initialize ⇒ Stack
constructor
A new instance of Stack.
- #push(instance) ⇒ Object
Constructor Details
#initialize ⇒ Stack
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 |