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
13
|
# File 'lib/memcacheable/fetcher.rb', line 7
def fetch
debug :read
Rails.cache.fetch cache_key do
debug :write
find_on_cache_miss
end
end
|
#flush ⇒ Object
15
16
17
|
# File 'lib/memcacheable/fetcher.rb', line 15
def flush
Rails.cache.delete cache_key
end
|