Class: RestrictCache::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/restrict_cache/base.rb

Class Method Summary collapse

Class Method Details

.cache_keyObject



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

def cache_key
  self.name
end

.instanceObject



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

def instance
  _cache = RestrictCache.custom_cache.contents(cache_key)
  _cache = RestrictCache.custom_cache.add(self.new) unless _cache
  _cache
end