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