valkey-objects 0.1.2 → 0.1.3
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 +10 -0
- 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: c254e2075a8930f89564a2ee4f6fe7e9cde96f2bbcd82ac360783e368ce9241a
|
4
|
+
data.tar.gz: 2fef0cdc246073f5774a40edb573f64a3dcb99a19e59cf662fb67b247e5083ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b132eb7b994c680429f46d97bd2fcacb68b4b9ab7e4940a162bf045cf5e84690ba84ede5ef4607a3bbef5e491177ce0ee90c553573c52ad9f6f4acdc142cbcc5
|
7
|
+
data.tar.gz: 50e7079727b7652ae0cbb2bc1e48a078ae2cca6a30f46313993b6c7a2d1aac2da302f36e617a0febcc759b83a409b3dd1caa04c05bad6b6638a1e790b9c59982
|
data/lib/valkey/objects.rb
CHANGED
@@ -145,6 +145,10 @@ module VK
|
|
145
145
|
Clock.new(k)
|
146
146
|
end
|
147
147
|
end
|
148
|
+
|
149
|
+
def self.at epoch
|
150
|
+
Time.at epoch
|
151
|
+
end
|
148
152
|
|
149
153
|
def self.clock *t
|
150
154
|
if t[0]
|
@@ -172,6 +176,12 @@ module VK
|
|
172
176
|
def value!
|
173
177
|
VK.redis.call("SET", key, "#{VK.clock.to_i}");
|
174
178
|
end
|
179
|
+
def ago
|
180
|
+
VK.clock.to_i - value;
|
181
|
+
end
|
182
|
+
def to_time
|
183
|
+
Time.at(value);
|
184
|
+
end
|
175
185
|
end
|
176
186
|
|
177
187
|
class T < O
|