module Plezi::Base::HasStore
Provides thread-specific caching engine, allowing lockless cache at the expenss of memory.
Public Instance Methods
get(key)
click to toggle source
Retrieves data form the cache
# File lib/plezi/render/has_cache.rb, line 30 def get(key) (Thread.current[(@_chache_name ||= object_id.to_s(16))] ||= {}.dup)[key] end
Also aliased as: []
store(key, value)
click to toggle source
Stores data in the cache
# File lib/plezi/render/has_cache.rb, line 25 def store(key, value) (Thread.current[(@_chache_name ||= object_id.to_s(16))] ||= {}.dup)[key] = value end
Also aliased as: []=