Class: Honeybadger::ContextManager Private

Inherits:
Object
  • Object
show all
Includes:
Conversions
Defined in:
lib/honeybadger/context_manager.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Constant Summary

Constants included from Conversions

Honeybadger::Conversions::MAX_CONTEXT_DEPTH

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Conversions

Context

Constructor Details

#initializeContextManager

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of ContextManager.



12
13
14
15
# File 'lib/honeybadger/context_manager.rb', line 12

def initialize
  @mutex = Mutex.new
  _initialize
end

Class Method Details

.currentObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



8
9
10
# File 'lib/honeybadger/context_manager.rb', line 8

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

Instance Method Details

#clear!Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



17
18
19
# File 'lib/honeybadger/context_manager.rb', line 17

def clear!
  _initialize
end

#get_contextObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



31
32
33
# File 'lib/honeybadger/context_manager.rb', line 31

def get_context
  @mutex.synchronize { @context }
end

#get_rack_envObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



39
40
41
# File 'lib/honeybadger/context_manager.rb', line 39

def get_rack_env
  @mutex.synchronize { @rack_env }
end

#set_context(hash) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



24
25
26
27
28
29
# File 'lib/honeybadger/context_manager.rb', line 24

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

#set_rack_env(env) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



35
36
37
# File 'lib/honeybadger/context_manager.rb', line 35

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