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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 23ee780fe6d6ebdc2bd6ba86a1c5dbf3260c3fda30ff914857882fa7da312a80
4
- data.tar.gz: 42ce906344c29813277144097d37db2da148ce9ad123d6823a0e3461c1e75c1e
3
+ metadata.gz: 1385c5e7ddc821d41bbf56e62bd47280c920fce6ff108feadbd2d34aeba38194
4
+ data.tar.gz: 7ead9b7f7673973a62f092d427dc0635b8c685dfbcc032a615ce45a6a551a72f
5
5
  SHA512:
6
- metadata.gz: da2294d42e443ff10c146158373d7018cdc476328a05fef5394b68417227578772ab91f930b785baf3eb22aa3ad6cc802734c12faa9b2343fabef93ca90daaa2
7
- data.tar.gz: 1090efd7a92f53aaa7846bc8ba4ac8cf6835ee651ddb99b612bfc8e230fffa19510c8dfe2e12bee740f62c8721f561f97552e74cdce190755e5e18fbc366a95c
6
+ metadata.gz: '09e6ee6a1cdb35f3238514672b60a3a8c734fc7bbcac020e8d32f9c35a080fb5262e2df5112231b7e7d8daf8bab01e9aba3db27c90fc0bcd74d91bc83216ab1e'
7
+ data.tar.gz: 6e392c12c109d10a7819ae8a87acc18b2093a82c30c14d2202da29a055fa5ef8123499c6fdb0f82b8604093f175cb98f4d6bcb6812a32b12a8297f580af440aa
@@ -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 ||= caller_method
59
- method_name = "#{caller_method}:#{method_locals}" unless method_locals.nil?
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveMemoize
4
- VERSION ||= '1.1.0'
4
+ VERSION ||= '1.1.1'
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.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez