lib/hari/keys/set.rb in hari-0.0.4 vs lib/hari/keys/set.rb in hari-0.0.5

- old
+ new

@@ -11,15 +11,15 @@ @name = name members end def members - Hari.redis.smembers key + desserialize Hari.redis.smembers(key) end def rand(count = 1) - Hari.redis.srandmember key, count + desserialize Hari.redis.srandmember(key, count) end def count Hari.redis.scard key end @@ -38,40 +38,40 @@ def many? count > 1 end def include?(member) - Hari.redis.sismember key, member + Hari.redis.sismember key, serialize(member) end alias :member? :include? def add(*members) - Hari.redis.sadd key, members + Hari.redis.sadd key, serialize(members) end def <<(member) add member end def delete(*members) - Hari.redis.srem key, members + Hari.redis.srem key, serialize(members) end def pop - Hari.redis.spop key + desserialize Hari.redis.spop(key) end def intersect(*set_queries) - Hari.redis.sinter key, set_query_keys(set_queries) + desserialize Hari.redis.sinter(key, set_query_keys(set_queries)) end def &(other_set_query) intersect other_set_query end def diff(*set_queries) - Hari.redis.sdiff key, set_query_keys(set_queries) + desserialize Hari.redis.sdiff(key, set_query_keys(set_queries)) end def -(other_set_query) diff other_set_query end