Method: Chewy.current

Defined in:
lib/chewy.rb

.currentHash

A thread-local variables accessor

Returns:

  • (Hash)


69
70
71
72
73
74
75
# File 'lib/chewy.rb', line 69

def current
  unless Thread.current.thread_variable?(:chewy)
    Thread.current.thread_variable_set(:chewy, {})
  end

  Thread.current.thread_variable_get(:chewy)
end