class SidekiqUniqueJobs::Redis::String
Class String
provides convenient access to redis strings
@author Mikael Henriksson <mikael@mhenrixon.com>
Public Instance Methods
Source
# File lib/sidekiq_unique_jobs/redis/string.rb, line 46 def count exist? ? 1 : 0 end
Used only for compatibility with other keys
@return [1] when key exists @return [0] when key does not exists
Source
# File lib/sidekiq_unique_jobs/redis/string.rb, line 37 def del(*) redis { |conn| conn.del(key) } end
Removes the key from redis
Source
# File lib/sidekiq_unique_jobs/redis/string.rb, line 28 def set(obj, pipeline = nil) return pipeline.set(key, obj) if pipeline redis { |conn| conn.set(key, obj) } end
Sets the value of the key to given object
@param [String] obj the object to update the key with
@return [true, false]
Source
# File lib/sidekiq_unique_jobs/redis/string.rb, line 17 def value redis { |conn| conn.get(key) } end
Returns the value of the key
@return [String]