Class: RestrictCache::CacheCollection::ActiveRecordCache

Inherits:
InnerCache
  • Object
show all
Defined in:
lib/restrict_cache/cache_collection/active_record_cache.rb

Instance Method Summary collapse

Methods inherited from InnerCache

#initialize, #size

Constructor Details

This class inherits a constructor from RestrictCache::CacheCollection::InnerCache

Instance Method Details

#add(content) ⇒ Object



4
5
6
7
8
# File 'lib/restrict_cache/cache_collection/active_record_cache.rb', line 4

def add(content)
  tbl_name, index = table_name_of(content), index_of(content)
  @caches[tbl_name] ||= {}
  @caches[tbl_name][index] = content
end

#contents(_table_name) ⇒ Object



10
11
12
# File 'lib/restrict_cache/cache_collection/active_record_cache.rb', line 10

def contents(_table_name)
  @caches[_table_name.to_sym]
end