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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c0a9c6aca1b5339587ab8d14cba5dee0fa05f0ffdb3460fd349282d384c76038
4
- data.tar.gz: 4d542d22a756ae8ce4dff600aae73f6f9a4cc41deb0db7abe91b6395a042fb02
3
+ metadata.gz: c254e2075a8930f89564a2ee4f6fe7e9cde96f2bbcd82ac360783e368ce9241a
4
+ data.tar.gz: 2fef0cdc246073f5774a40edb573f64a3dcb99a19e59cf662fb67b247e5083ef
5
5
  SHA512:
6
- metadata.gz: 50cff3351928a9b7f66f871f9fdab25f65646e7b4978eb981f1e9671babe40472e95a1d8e5c8121aa285cc64fb6148ee8488af852b8de9b87ed17338274e1bbc
7
- data.tar.gz: e823ed4e7c79546888de0e527384fb02860c992b8ac5ad8c09072ba9ba9d461c312cb64dfc7867a60dda0aca55ca0aee889a6fc0e1c5db2db222da5da403be9a
6
+ metadata.gz: b132eb7b994c680429f46d97bd2fcacb68b4b9ab7e4940a162bf045cf5e84690ba84ede5ef4607a3bbef5e491177ce0ee90c553573c52ad9f6f4acdc142cbcc5
7
+ data.tar.gz: 50e7079727b7652ae0cbb2bc1e48a078ae2cca6a30f46313993b6c7a2d1aac2da302f36e617a0febcc759b83a409b3dd1caa04c05bad6b6638a1e790b9c59982
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Valkey
4
4
  module Objects
5
- VERSION = "0.1.2"
5
+ VERSION = "0.1.3"
6
6
  end
7
7
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: valkey-objects
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Olson