Module: Lore::Cache

Defined in:
lib/lore/cache/bits.rb,
lib/lore/cache/cacheable.rb,
lib/lore/cache/file_index.rb,
lib/lore/cache/cached_entities.rb,
lib/lore/cache/mmap_entity_cache.rb,
lib/lore/exception/cache_exception.rb,
lib/lore/cache/abstract_entity_cache.rb

Defined Under Namespace

Modules: Cache_Helpers, Cacheable Classes: Abstract_Entity_Cache, Cache_Read_Exception, Cache_Write_Exception, Cached_Entities, File_Index, Mmap_Entity_Cache

Constant Summary collapse

@@ignore_params =
[ 'cb__model', 'cb__controller', 'cb__mode' ]

Class Method Summary collapse

Class Method Details

.store_name(klass_name, controller, mode, keys) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/lore/cache/bits.rb', line 7

def self.store_name(klass_name, controller, mode, keys)
  key_string = ''
  keys.each_pair { |name, value|
    key_string += '@@@'+name+'==' << value.to_s unless @@ignore_params.include? name
  }
  controller = '*' if controller == :all
  mode = '*'       if mode == :all
  
  store_name  = '/tmp/cb__cache__' << klass_name.to_s << '@@@' << controller.to_s << '@@@' << mode.to_s
  store_name += key_string unless key_string == ''

  return store_name
end