class FrozenRecord::Base::ThreadSafeStorage
Public Class Methods
new(key)
click to toggle source
# File lib/frozen_record/base.rb, line 28 def initialize(key) @thread_key = "#{ self.object_id }-#{ key }" end
Public Instance Methods
[](key)
click to toggle source
# File lib/frozen_record/base.rb, line 32 def [](key) Thread.current[@thread_key] ||= {} Thread.current[@thread_key][key] end
[]=(key, value)
click to toggle source
# File lib/frozen_record/base.rb, line 37 def []=(key, value) Thread.current[@thread_key] ||= {} Thread.current[@thread_key][key] = value end