Class: EntityCache::Storage::Temporary::Scope::Shared
Instance Attribute Summary
#subject
Instance Method Summary
collapse
build, configure, #get, #initialize, #put
Instance Method Details
#records ⇒ Object
6
7
8
|
# File 'lib/entity_cache/storage/temporary/scope/shared.rb', line 6
def records
subject_registry[subject] ||= {}
end
|
#subject_registry ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/entity_cache/storage/temporary/scope/shared.rb', line 10
def subject_registry
current_thread = Thread.current
if current_thread.thread_variable?(thread_local_variable)
subject_registry = current_thread.thread_variable_get(thread_local_variable)
else
subject_registry = {}
current_thread.thread_variable_set(thread_local_variable, subject_registry)
end
subject_registry
end
|
#thread_local_variable ⇒ Object
24
25
26
|
# File 'lib/entity_cache/storage/temporary/scope/shared.rb', line 24
def thread_local_variable
:entity_cache_subject_registry
end
|