Module: Lore::Cache::Cache_Helpers

Included in:
Memcache_Entity_Cache, Memory_Entity_Cache, Mmap_Entity_Cache
Defined in:
lib/lore/cache/abstract_entity_cache.rb

Instance Method Summary collapse

Instance Method Details

#create_store(storefile_name) ⇒ Object



76
77
78
79
# File 'lib/lore/cache/abstract_entity_cache.rb', line 76

def create_store(storefile_name)
  store = PStore.new(storefile_name) unless storefile_name.nil?
  return store
end

#index_for(query) ⇒ Object



68
69
70
# File 'lib/lore/cache/abstract_entity_cache.rb', line 68

def index_for(query)
  Digest::MD5.hexdigest(query)
end

#storefile_of(model_name, query) ⇒ Object



72
73
74
# File 'lib/lore/cache/abstract_entity_cache.rb', line 72

def storefile_of(model_name, query)
  "/tmp/lore_cache__#{model_name}_#{Digest::MD5.hexdigest(query)}"
end