active_memoize 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_memoize/cache.rb +3 -2
- data/lib/active_memoize/version.rb +1 -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: 1385c5e7ddc821d41bbf56e62bd47280c920fce6ff108feadbd2d34aeba38194
|
4
|
+
data.tar.gz: 7ead9b7f7673973a62f092d427dc0635b8c685dfbcc032a615ce45a6a551a72f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '09e6ee6a1cdb35f3238514672b60a3a8c734fc7bbcac020e8d32f9c35a080fb5262e2df5112231b7e7d8daf8bab01e9aba3db27c90fc0bcd74d91bc83216ab1e'
|
7
|
+
data.tar.gz: 6e392c12c109d10a7819ae8a87acc18b2093a82c30c14d2202da29a055fa5ef8123499c6fdb0f82b8604093f175cb98f4d6bcb6812a32b12a8297f580af440aa
|
data/lib/active_memoize/cache.rb
CHANGED
@@ -55,8 +55,9 @@ module ActiveMemoize
|
|
55
55
|
|
56
56
|
def memoize(method_name = nil, &block)
|
57
57
|
method_locals = caller_locals(block)
|
58
|
-
method_name ||=
|
59
|
-
|
58
|
+
method_name ||= begin
|
59
|
+
method_locals.nil? ? caller_method : "#{caller_method}:#{method_locals}"
|
60
|
+
end
|
60
61
|
|
61
62
|
return @cache[method_name] if @cache.key?(method_name)
|
62
63
|
|