Class: Memcacheable::Fetcher
- Inherits:
-
Object
- Object
- Memcacheable::Fetcher
show all
- Defined in:
- lib/memcacheable/fetcher.rb
Instance Method Summary
collapse
Instance Method Details
#debug(action) ⇒ Object
3
4
5
|
# File 'lib/memcacheable/fetcher.rb', line 3
def debug(action)
Rails.logger.debug "[memcacheable] #{action} #{description}"
end
|
#fetch ⇒ Object
7
8
9
10
11
12
|
# File 'lib/memcacheable/fetcher.rb', line 7
def fetch
debug :read
Rails.cache.fetch cache_key do
find_on_cache_miss.tap { debug :write }
end
end
|
#flush ⇒ Object
14
15
16
|
# File 'lib/memcacheable/fetcher.rb', line 14
def flush
Rails.cache.delete cache_key
end
|