class ActiveOrm::Redis::Set < ActiveOrm::Redis def self.find(key) value = client.smembers(normalize_key(key)) value = metatransform(value) value end def self.combine(*args) value = client.sunion(*args) value = metatransform(value) value end def self.difference(*args) value = client.sdiff(*args) value = metatransform(value) value end def self.intersection(key, *args) value = client.sinter(normalize_key(key), *args) value = metatransform(value) value end def self.sample(key, value=1) value = client.srandmember(normalize_key(key), value) value = metatransform(value) value end def self.value?(key, value) client.sismember(normalize_key(key), value) end def self.count(key) client.scard(normalize_key(key)) end def self.create(key, *args) client.sadd(normalize_key(key), args) end def self.create_combination(key, *args) client.sunionstore(normalize_key(key), *args) end def self.create_difference(key, *args) client.sdiffstore(normalize_key(key), *args) end def self.create_intersection(key, *args) client.sinterstore(normalize_key(key), *args) end def self.move(key, destination, value) client.smove(normalize_key(key), destination.to_s, value) end def self.destroy(key, *args) client.srem(normalize_key(key), *args) end def self.destroy_random(key) client.spop(normalize_key(key)) end def self.scan(key, cursor, opts={}) client.sscan(normalize_key(key), cursor, opts) end end