class Airbrake::Context
@since v5.2.1
@api private
Airbrake::Context.current.merge!(foo: ‘bar’)
@example
information added via {Airbrake.merge_context} calls.
Represents a thread-safe Airbrake context object, which carries arbitrary
def self.current
-
(self)
-
def self.current Thread.current[:airbrake_context] ||= new end
def clear
-
(Hash)
- clears (resets) the current context
def clear @mutex.synchronize do @context.clear end end
def empty?
-
(Boolean)
- checks whether the context has any data
def empty? @context.empty? end
def initialize
def initialize @mutex = Mutex.new @context = {} end
def merge!(other)
-
(void)
-
Parameters:
-
other
(Hash{Object=>Object}
) --
def merge!(other) @mutex.synchronize do @context.merge!(other) end end
def to_h
-
(Hash)
- duplicated Hash context
def to_h @mutex.synchronize do @context.dup end end