Module: Airbrake::Rack::RequestStore Private

Defined in:
lib/airbrake/rack/request_store.rb

Overview

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

RequestStore is a thin (and limited) wrapper around Thread.current that allows writing and reading thread-local variables under the :airbrake key.

Since:

  • v8.1.3

Class Method Summary collapse

Class Method Details

.[](key) ⇒ 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.

Returns:

  • (Object)

Since:

  • v8.1.3



23
24
25
# File 'lib/airbrake/rack/request_store.rb', line 23

def [](key)
  store[key]
end

.[]=(key, value) ⇒ void

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.

This method returns an undefined value.

Since:

  • v8.1.3



18
19
20
# File 'lib/airbrake/rack/request_store.rb', line 18

def []=(key, value)
  store[key] = value
end

.clearvoid

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.

This method returns an undefined value.

Since:

  • v8.1.3



28
29
30
# File 'lib/airbrake/rack/request_store.rb', line 28

def clear
  Thread.current[:airbrake] = {}
end

.storeHash

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 hash for all request-related data.

Returns:

  • (Hash)

    a hash for all request-related data

Since:

  • v8.1.3



13
14
15
# File 'lib/airbrake/rack/request_store.rb', line 13

def store
  Thread.current[:airbrake] ||= {}
end