Method: Dalli::Client#replace_cas
- Defined in:
- lib/dalli/cas/client.rb
#replace_cas(key, value, cas, ttl = nil, options = nil) ⇒ Object
Conditionally add a key/value pair, verifying existing CAS, only if the key already exists on the server. Returns the new CAS value if the operation succeeded, or falsy otherwise.
47 48 49 50 |
# File 'lib/dalli/cas/client.rb', line 47 def replace_cas(key, value, cas, ttl=nil, =nil) ttl ||= [:expires_in].to_i perform(:replace, key, value, ttl, cas, ) end |