Method: Dalli::Client#add

Defined in:
lib/dalli/client.rb

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

Conditionally add a key/value pair, if the key does not already exist on the server. Returns true if the operation succeeded.



179
180
181
182
# File 'lib/dalli/client.rb', line 179

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