Class: Horizon::ThreadLocalContextStore

Inherits:
Object
  • Object
show all
Defined in:
lib/horizon/thread_local_context_store.rb

Instance Method Summary collapse

Instance Method Details

#current_contextObject



7
8
9
# File 'lib/horizon/thread_local_context_store.rb', line 7

def current_context
  Thread.current[:horizon_context] ||= Horizon::Context.new
end

#current_context=(context) ⇒ Object



3
4
5
# File 'lib/horizon/thread_local_context_store.rb', line 3

def current_context=(context)
  Thread.current[:horizon_context] = context
end