short_circu_it 0.6.0.pre3 → 0.6.0

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: 61b535d25be7d695b439740a4768ca838186d3336d1a21223577aec1405bd667
4
- data.tar.gz: fc52132fd9926f40efd88a22e39dddd724be1a63b83d63ed27961b25a96d9cd6
3
+ metadata.gz: 929f965c27fd65d81404dd6679b49e22144b2c30eda2d70c5366c330f4267cac
4
+ data.tar.gz: 206cee4f666cadbd83a4e6d6286079a79602b1457462395db3d5ce432329d150
5
5
  SHA512:
6
- metadata.gz: 1360b6964c0559e27cb77c01f57c1dbf121cee569252a496f408c0e578f299e310ed24b2cd89c3e1fd6a1cdd7426229e426f4f6e5ccb56256c47496574a28993
7
- data.tar.gz: fcd2d5ce186f8ddbce48b4dcfc5079b404257e38b8b7c6e3ca43e07ec1e745783efd2884d15215f83bb9457cd0de9100309339089ebcdbc34567464fc6c48a22
6
+ metadata.gz: 2a018ad63e0ec41ada2a01d06dd6333a553e8da83c836efbd36aae53d69a7bd478b508c4953eed2da5a07ec85d4a521696a374a44a4939a1976884e432d0bb07
7
+ data.tar.gz: 6cbfbf5e216586bc9928903b88fdfceb1dc0851d122c096568dea8c67f74509f3c6db3b50ceeb8675492d82690b88697ee0532921df5ac503e8acda6cbc629d1
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ShortCircuIt
4
- VERSION = "0.6.0.pre3"
4
+ VERSION = "0.6.0"
5
5
  end
@@ -26,8 +26,9 @@ module ShortCircuIt
26
26
 
27
27
  class_methods do
28
28
  def memoization_observers
29
- @memoization_observers ||=
30
- superclass.respond_to?(:memoization_observers) ? superclass.memoization_observers : {}
29
+ return _memoization_observers unless superclass.respond_to?(:memoization_observers)
30
+
31
+ superclass.memoization_observers.merge(_memoization_observers)
31
32
  end
32
33
 
33
34
  protected
@@ -87,11 +88,15 @@ module ShortCircuIt
87
88
 
88
89
  private
89
90
 
90
- attr_writer :memoization_observers
91
+ attr_writer :_memoization_observers
92
+
93
+ def _memoization_observers
94
+ @_memoization_observers ||= {}
95
+ end
91
96
 
92
97
  def add_memoized_observers(method_name, observers)
93
98
  # TODO: Raise an error if method has already been memoized? A warning maybe?
94
- self.memoization_observers = memoization_observers.
99
+ self._memoization_observers = _memoization_observers.
95
100
  merge(method_name.to_sym => Array.wrap(observers).freeze).
96
101
  freeze
97
102
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: short_circu_it
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0.pre3
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Allen Rettberg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-12 00:00:00.000000000 Z
11
+ date: 2019-03-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.6.0.pre3
33
+ version: 0.6.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 0.6.0.pre3
40
+ version: 0.6.0
41
41
  description: Memoize methods safely with parameter and dependency observation
42
42
  email:
43
43
  - allen.rettberg@freshly.com
@@ -66,11 +66,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
66
66
  version: '0'
67
67
  required_rubygems_version: !ruby/object:Gem::Requirement
68
68
  requirements:
69
- - - ">"
69
+ - - ">="
70
70
  - !ruby/object:Gem::Version
71
- version: 1.3.1
71
+ version: '0'
72
72
  requirements: []
73
- rubygems_version: 3.0.3
73
+ rubyforge_project:
74
+ rubygems_version: 2.7.6
74
75
  signing_key:
75
76
  specification_version: 4
76
77
  summary: Effortless memoization