active_memoize 1.0.2 → 1.0.3

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
  SHA256:
3
- metadata.gz: 425d8890f016d16f38c83696cbaea31b94464e8ba4ad342d9269105c13088ce6
4
- data.tar.gz: 3f3811292ef795f16bb98e97f08808da42bf3609e576aa28f98ef0211d580fea
3
+ metadata.gz: 825d56d2f91c7f4e6410adb6a0954bb30e011633b1802dc37ce6ca619ecf4b4e
4
+ data.tar.gz: 11ce236a5ba5172b378c449b4c291ede92ec9c88d32b483d54f014ca76ded3a8
5
5
  SHA512:
6
- metadata.gz: a30a94212503902063d674fd76c1b553db9d4ddaa565b515c567cc48557cef149e886eb7d1688250adfa043bcffbc2daec8c86566475dca60c5174e8e5e392a5
7
- data.tar.gz: c7acaedbddbec2d474ca41281512cf044e62639c1d044416b67ccf2a49cf217986be6eb654f48a6e039e024c3ab0841480b808a243598c1e1834a4f3172d4ac4
6
+ metadata.gz: 119719ab6e15811eaaada9272bedfbb369c062fe06c762ce9b9ac3b71c17b66e9df49ce2e56b439eec93f86b67312fa3c8c151290f8cfc2a2ae0f454e97b4e6c
7
+ data.tar.gz: fec75cbb9dc8248017f58fc43b58ad261a86f42d9e4f1dd0962c6f210b1948a259924fc2ef9ac64b2fa5e0488748b90b7901d5549d2194b24f432f07b27206c8
@@ -54,7 +54,10 @@ module ActiveMemoize
54
54
  end
55
55
 
56
56
  def memoize(&block)
57
- method_name = [caller_method, caller_locals(block)].compact.join(':')
57
+ method_locals = caller_locals(block)
58
+ method_name = caller_method
59
+ method_name = "#{caller_method}:#{method_locals}" unless method_locals.nil?
60
+
58
61
  return @cache[method_name] if @cache.key?(method_name)
59
62
 
60
63
  @cache[method_name] = yield(block)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveMemoize
4
- VERSION ||= '1.0.2'
4
+ VERSION ||= '1.0.3'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_memoize
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez