class ActiveOrm::Redis::Key < ActiveOrm::Redis def self.exists?(key) client.exists(normalize_key(key)) end def self.type?(key) client.type(normalize_key(key)) end def self.ttl?(key, format=:seconds) seconds?(format) ? client.ttl(normalize_key(key)) : client.pttl(normalize_key(key)) end def self.sort(key, opts={}) client.sort(normalize_key(key), opts) end def self.sample client.randomkey end def self.rename(key, value) client.rename(normalize_key(key), value.to_s) end def self.rename!(key, value) client.renamenx(normalize_key(key), value.to_s) end def self.destroy(key) client.del(normalize_key(key)) end def self.persist(key) client.persist(normalize_key(key)) end def self.expire(key, seconds, format=:seconds) seconds?(format) ? client.expire(normalize_key(key), seconds) : client.pexpire(normalize_key(key), seconds) end def self.expire_at(key, seconds, format=:seconds) seconds?(format) ? client.expireat(normalize_key(key), seconds) : client.pexpireat(normalize_key(key), seconds) end def self.dump(key) client.dump(normalize_key(key)) end def self.match(pattern='*') value = client.keys(normalize_key(pattern)) value = nil if value.empty? value end def self.migrate(key, options) client.migrate(normalize_key(key), options) end def self.move(key, destination) client.move(normalize_key(key), destination) end def self.object(*args) client.object(args) end def self.restore(key, milliseconds, value) client.restore(normalize_key(key), milliseconds, value) end def self.sort(key, opts={}) client.sort(normalize_key(key), opts) end def self.scan(cursor, opts={}) client.scan(cursor, opts) end end