Class: ActiveSupport::EventContext
- Defined in:
- lib/active_support/event_reporter.rb
Overview
:nodoc:
Constant Summary collapse
- EMPTY_CONTEXT =
{}.freeze
- FIBER_KEY =
:event_reporter_context
Class Method Summary collapse
Class Method Details
.clear ⇒ Object
65 66 67 |
# File 'lib/active_support/event_reporter.rb', line 65 def clear Fiber[FIBER_KEY] = EMPTY_CONTEXT end |
.context ⇒ Object
54 55 56 |
# File 'lib/active_support/event_reporter.rb', line 54 def context Fiber[FIBER_KEY] || EMPTY_CONTEXT end |
.set_context(context_hash) ⇒ Object
58 59 60 61 62 63 |
# File 'lib/active_support/event_reporter.rb', line 58 def set_context(context_hash) new_context = self.context.dup context_hash.each { |key, value| new_context[key.to_sym] = value } Fiber[FIBER_KEY] = new_context.freeze end |