Module: Sinatra::Cache

Defined in:
lib/herbert/Services.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.registered(app) ⇒ Object



18
19
20
21
22
23
24
25
26
# File 'lib/herbert/Services.rb', line 18

def self.registered(app)
  servers = []
  app.settings.cache[:servers].each {|c|
    servers << (c[:host] + ':' + (c[:port] || 11211).to_s)
  }
  app.set :cache, MemCache.new(app.settings.cache[:options])
  app.settings.cache.servers = servers
  log.h_debug("Connected to Memcached #{app.settings.cache.inspect}")
end

Instance Method Details

#mcObject



28
29
30
# File 'lib/herbert/Services.rb', line 28

def mc
  settings.cache
end