redis-set 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/redis_set.rb +11 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0efb160f34bf9451eb7605c59bb3bf3c41c903f2
|
4
|
+
data.tar.gz: a60bbfe301fe51c71bdda362643fa04f906830d4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac5ac7eb78d8dc9173e0a7bad164d9c7f639af82c5d57a30a652a0fdf565614c47fc47e623a51e7f4cd7200a58056b7da6f59e620188c6d59c3fba82fc045cc0
|
7
|
+
data.tar.gz: 890b3325f802ad823122718f1803bf1f17e82957eab2e95c57bc64faed37123457d4cb7ac6639fcb0545fa9357630aa5b2c974d45219d142174e72f5131dc271
|
data/lib/redis_set.rb
CHANGED
@@ -3,7 +3,7 @@ require "redis"
|
|
3
3
|
class RedisSet
|
4
4
|
attr_reader :name
|
5
5
|
|
6
|
-
VERSION = "0.0.
|
6
|
+
VERSION = "0.0.6"
|
7
7
|
|
8
8
|
class InvalidNameException < StandardError; end;
|
9
9
|
class InvalidRedisConfigException < StandardError; end;
|
@@ -70,15 +70,18 @@ class RedisSet
|
|
70
70
|
|
71
71
|
def intersection *sets
|
72
72
|
sets = [sets].flatten
|
73
|
-
|
74
|
-
|
75
|
-
s.
|
76
|
-
|
77
|
-
|
73
|
+
if sets.size >= 1
|
74
|
+
sets = sets.map do |s|
|
75
|
+
if s.kind_of?(self.class)
|
76
|
+
s.name
|
77
|
+
else
|
78
|
+
s
|
79
|
+
end
|
78
80
|
end
|
79
|
-
|
81
|
+
sets << name
|
80
82
|
|
81
|
-
|
83
|
+
with{|redis| redis.sinter *sets }
|
84
|
+
end
|
82
85
|
end
|
83
86
|
|
84
87
|
def scan cursor = 0, amount = 10, match = "*"
|