class RailsWebCache::Base
Attributes
cache[R]
Public Class Methods
new(cache)
click to toggle source
# File lib/rails_web_cache/base.rb, line 7 def initialize(cache) @cache = cache end
Public Instance Methods
clear()
click to toggle source
# File lib/rails_web_cache/base.rb, line 15 def clear cache.clear end
delete(key)
click to toggle source
# File lib/rails_web_cache/base.rb, line 23 def delete(key) cache.delete(key) if key end
entry(key, options = {})
click to toggle source
# File lib/rails_web_cache/base.rb, line 27 def entry(key, options = {}) return unless key entry = read_entry(key, options) return unless entry RailsWebCache::Entry.new(entry) end
keys_size()
click to toggle source
# File lib/rails_web_cache/base.rb, line 11 def keys_size keys.size end
read(key)
click to toggle source
# File lib/rails_web_cache/base.rb, line 19 def read(key) cache.read(key) if key end
search(query = '')
click to toggle source
# File lib/rails_web_cache/base.rb, line 34 def search(query = '') keys.select { |key| key.downcase.include?(query.downcase) } if query end
Private Instance Methods
read_entry(key, options = {})
click to toggle source
# File lib/rails_web_cache/base.rb, line 40 def read_entry(key, options = {}) cache.send(:read_entry, key, options) end