module RedisModel::Types::Base

Internal: Provides methods for Redis commands related to plain key operations and helpers.

Public Instance Methods

clear()
Alias for: del
connection() click to toggle source

Public: Helper method for global Redis connection.

Returns global Redis connection object.

# File lib/redis_model/types/base.rb, line 27
def connection
  RedisModel::Base.connection
end
del() click to toggle source

Public: Removes Redis value associated with the key using Redis command DEL.

Returns 1 if key is deleted, 0 otherwise.

# File lib/redis_model/types/base.rb, line 18
def del
  connection.del(key_label)
end
Also aliased as: clear
exists?() click to toggle source

Public: Asserts existence of Redis key having the label using Redis command ExiSTS.

Returns true if key exists, false otherwise.

# File lib/redis_model/types/base.rb, line 10
def exists?
  connection.exists(key_label)
end