class OpenTracingTestTracer::ScopeManager::ScopeStack

@api private

Public Class Methods

new() click to toggle source
# File lib/signalfx_test_tracer/scope_manager/scope_stack.rb, line 7
def initialize
  # Generate a random identifier to use as the Thread.current key. This is
  # needed so that it would be possible to create multiple tracers in one
  # thread (mostly useful for testing purposes)
  @scope_identifier = ScopeIdentifier.generate
end

Public Instance Methods

peek() click to toggle source
# File lib/signalfx_test_tracer/scope_manager/scope_stack.rb, line 22
def peek
  store.last
end
pop() click to toggle source
# File lib/signalfx_test_tracer/scope_manager/scope_stack.rb, line 18
def pop
  store.pop
end
push(scope) click to toggle source
# File lib/signalfx_test_tracer/scope_manager/scope_stack.rb, line 14
def push(scope)
  store << scope
end

Private Instance Methods

store() click to toggle source
# File lib/signalfx_test_tracer/scope_manager/scope_stack.rb, line 28
def store
  Thread.current[@scope_identifier] ||= []
end