valkey-objects 0.1.6 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/valkey/objects/version.rb +1 -1
- data/lib/valkey/objects.rb +9 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2d76e237c36d52756f924cce5766312f630e6ae7c4a378aa7c0850fa945ed58
|
4
|
+
data.tar.gz: 3a320e4c5278fe4974b4749f4788c9eedc7b984a7d1949ff39ab22be3bedfe2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 864a0c22c28689313528d526b1fd26cafc3957df0a75f7a72cfcc30b87860233a7d9e2c440bbd4e95af1e87777aa589fe075d8da350400c17290321762596695
|
7
|
+
data.tar.gz: a9554e5a2e77b8420c9df3a0b15031237c1d1f6e1f6844c14bc510117e3755a83483f4c26a30a6744124314062bb27fef5dbd35d8c75483fddabf81bdd021584
|
data/lib/valkey/objects.rb
CHANGED
@@ -242,6 +242,14 @@ module VK
|
|
242
242
|
def value= x
|
243
243
|
VK.redis.call("SET", key, x)
|
244
244
|
end
|
245
|
+
def match r, &b
|
246
|
+
m = Regexp.new(r).match(value)
|
247
|
+
if block_given?
|
248
|
+
b.call(m)
|
249
|
+
else
|
250
|
+
return m
|
251
|
+
end
|
252
|
+
end
|
245
253
|
end
|
246
254
|
|
247
255
|
class C < O
|
@@ -306,7 +314,7 @@ module VK
|
|
306
314
|
VK.redis.call("SMEMBERS", key).each_with_index { |e, i| b.call(i, e) }
|
307
315
|
end
|
308
316
|
def include? k
|
309
|
-
if VK.redis.call("SMISMEMBER", key, k)[0] ==
|
317
|
+
if VK.redis.call("SMISMEMBER", key, k)[0] == 0
|
310
318
|
return false
|
311
319
|
else
|
312
320
|
return true
|