Class: EntityCache::Store::Internal::Scope::Thread
Instance Attribute Summary
#subject
Instance Method Summary
collapse
build, configure, #count, #delete, #empty?, #get, #put
Instance Method Details
#records ⇒ Object
6
7
8
|
# File 'lib/entity_cache/store/internal/scope/thread.rb', line 6
def records
records_by_subject[subject]
end
|
#records_by_subject ⇒ Object
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/entity_cache/store/internal/scope/thread.rb', line 10
def records_by_subject
current_thread = ::Thread.current
records_by_subject = current_thread.thread_variable_get(thread_variable)
if records_by_subject.nil?
records_by_subject = Hash.new do |hash, subject|
hash[subject] = {}
end
current_thread.thread_variable_set(thread_variable, records_by_subject)
end
records_by_subject
end
|