class Honeybadger::ContextManager

Experimental RBS support (using type sampling data from the type_fusion project).

# sig/honeybadger/context_manager.rbs

class Honeybadger::ContextManager
  def _initialize: () -> nil
  def initialize: () -> void
end

@api private

def self.current

def self.current
  Thread.current[:__hb_context_manager] ||= new
end

def _initialize

Experimental RBS support (using type sampling data from the type_fusion project).

def _initialize: () -> nil

This signature was generated using 1 sample from 1 application.

def _initialize
  @mutex.synchronize do
    @context = nil
    @rack_env = nil
  end
end

def clear!

def clear!
  _initialize
end

def get_context

def get_context
  @mutex.synchronize { @context }
end

def get_rack_env

def get_rack_env
  @mutex.synchronize { @rack_env }
end

def initialize

Experimental RBS support (using type sampling data from the type_fusion project).

def initialize: () -> void

This signature was generated using 1 sample from 1 application.

def initialize
  @mutex = Mutex.new
  _initialize
end

def set_context(hash)

def set_context(hash)
  @mutex.synchronize do
    @context ||= {}
    @context.update(Context(hash))
  end
end

def set_rack_env(env)

def set_rack_env(env)
  @mutex.synchronize { @rack_env = env }
end