Class: Mcache::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/mcache/client.rb

Instance Method Summary collapse

Instance Method Details

#fetch(key, options = {}) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/mcache/client.rb', line 5

def fetch(key, options = {})
  Mcache.connection.run do |cn|
    cn.fetch(key, options.fetch(:expires_in, 0)) do
      yield
    end
  end
end