forget_table 0.0.1 → 0.0.2
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2c9b1ef276b379ae6552110f0b5578918970f391
|
4
|
+
data.tar.gz: 0fdbf0d6b22f7654edcd6186549276b20f61486d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be440481a82942e904bdddfacf64589efbb4304c4227baa01063f685ef5257e91517c12b94f5aa4f906ce6b1d5e70b6f5ea2d77179fdbd9163a6f6dad3c96748
|
7
|
+
data.tar.gz: 43326a746a2b82cd2f879cf3ce41564cd813a888560d6b0b00abd76db84783f603977eccca8206046d408c46e2c0a36505a44771227313f9de1e4bdb030e7b97
|
data/lib/forget_table.rb
CHANGED
data/lib/forget_table/decay.rb
CHANGED
@@ -25,8 +25,12 @@ module ForgetTable
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def decrement(values)
|
28
|
-
decay = Decay.new(last_updated_at)
|
28
|
+
decay = Decay.new(last_updated_at, decay_rate)
|
29
29
|
values.map { |value| decay.decay_value(value) }
|
30
30
|
end
|
31
|
+
|
32
|
+
def decay_rate
|
33
|
+
ForgetTable::Configuration.decay_rate
|
34
|
+
end
|
31
35
|
end
|
32
36
|
end
|
@@ -20,7 +20,9 @@ describe ForgetTable::DistributionDecrementer do
|
|
20
20
|
end
|
21
21
|
|
22
22
|
before do
|
23
|
-
allow(ForgetTable::Decay).to receive(:new).with(
|
23
|
+
allow(ForgetTable::Decay).to receive(:new).with(
|
24
|
+
last_updated_at, ForgetTable::Configuration.decay_rate
|
25
|
+
) { |arg| FakeDecay.new(arg) }
|
24
26
|
end
|
25
27
|
|
26
28
|
class FakeDecay
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: forget_table
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicolò Calcavecchia
|
@@ -74,6 +74,7 @@ extensions: []
|
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
76
|
- lib/forget_table.rb
|
77
|
+
- lib/forget_table/configuration.rb
|
77
78
|
- lib/forget_table/decay.rb
|
78
79
|
- lib/forget_table/decrementer.rb
|
79
80
|
- lib/forget_table/distribution.rb
|