valkey-objects 0.4.3 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/valkey/objects/version.rb +1 -1
- data/lib/valkey/objects.rb +8 -3
- 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: e0a0f27f825bc339253e5700cae498f99de96f7261ca3f4c7a2da047a9a094b3
|
4
|
+
data.tar.gz: 4492602d5343e12780dbc212ed5fd0a7619c12e70d17edbc264753d2f018a2a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01f45565478998884afb87f23f37457995fc35814d2780e864bbd102dd065cedd5ae93b1620e76373b4924635110a91321586eaaa46dc28482bbf16de13da4a3
|
7
|
+
data.tar.gz: 697cf994b0b4df0647870c358c66c6b91174fccef79fa2df3f72ee7c2c2006c454e9fee1c80630ba1b189a51aa884d6a561b42fcf763a44141e7edcd07854ebe
|
data/lib/valkey/objects.rb
CHANGED
@@ -469,7 +469,7 @@ module VK
|
|
469
469
|
end
|
470
470
|
end
|
471
471
|
def last
|
472
|
-
VK.redis.call("LRANGE", key, -1,-1)
|
472
|
+
VK.redis.call("LRANGE", key, -1,-1)[0]
|
473
473
|
end
|
474
474
|
def length
|
475
475
|
VK.redis.call("LLEN", key)
|
@@ -489,6 +489,11 @@ module VK
|
|
489
489
|
delete!
|
490
490
|
end
|
491
491
|
end
|
492
|
+
def to_h
|
493
|
+
h = {}
|
494
|
+
VK.redis.call("ZREVRANGE", key, 0, -1, 'WITHSCORES').each_with_index { |e, i| h[e[0]] = e[1] }
|
495
|
+
return h
|
496
|
+
end
|
492
497
|
def [] k
|
493
498
|
VK.redis.call("ZSCORE", key, k).to_f;
|
494
499
|
end
|
@@ -638,10 +643,10 @@ module VK
|
|
638
643
|
return hx
|
639
644
|
end
|
640
645
|
def first
|
641
|
-
VK.redis.call("LRANGE", key, 0, 0)
|
646
|
+
VK.redis.call("LRANGE", key, 0, 0)[0]
|
642
647
|
end
|
643
648
|
def last
|
644
|
-
VK.redis.call("LRANGE", key, -1, -1)
|
649
|
+
VK.redis.call("LRANGE", key, -1, -1)[0]
|
645
650
|
end
|
646
651
|
end
|
647
652
|
|