Method: Dalli::Client#replace

Defined in:
lib/dalli/client.rb

#replace(key, value, ttl = nil, options = nil) ⇒ Object

Conditionally add a key/value pair, only if the key already exists on the server. Returns true if the operation succeeded.



187
188
189
190
# File 'lib/dalli/client.rb', line 187

def replace(key, value, ttl=nil, options=nil)
  ttl ||= @options[:expires_in].to_i
  perform(:replace, key, value, ttl, options)
end