Method: Merb::Cache::MemcachedStore#write

Defined in:
lib/merb-cache/stores/fundamental/memcached_store.rb

#write(key, data = nil, parameters = {}, conditions = {}) ⇒ Object

Writes data to the cache using key, parameters and conditions.



34
35
36
37
38
39
40
41
42
43
# File 'lib/merb-cache/stores/fundamental/memcached_store.rb', line 34

def write(key, data = nil, parameters = {}, conditions = {})
  if writable?(key, parameters, conditions)
    begin
      @memcached.set(normalize(key, parameters), data, expire_time(conditions))
      true
    rescue
      nil
    end
  end
end