short_circu_it 0.6.0.pre → 0.6.0.pre2

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: b33b859e595e10c199fdd17bd805206e1035e5d879e442386a8d852b3121c44d
4
- data.tar.gz: a2abbe0325968d9f7e9b0b4b2c14bc2c73e63ecddc0bafa69c2798929942a502
3
+ metadata.gz: b792f7aa950ffdc6488504175694615fe24ec827a7ce1eea39820911ee0832ac
4
+ data.tar.gz: ce2095acdb61f385227b30968e01eda49a8d451fd968fc23662344b3f7c2c7f9
5
5
  SHA512:
6
- metadata.gz: 2414b41886dd4acb0f991a5ee4ab2c2a23d60ed508738af91497c61a195ea9b816655624fc767573566d8b41cb52d0757ab9a58d9b69862f4a4a3073cddc9c44
7
- data.tar.gz: b0a3c74002e77db75b7a204d328a4f48f57eb9e4b0315cf14b3665f59d6be6ec8950b548d841ae9916d3da399c04d6b8294a2883cc0ead8ff3a343490c9cbb25
6
+ metadata.gz: ea6446e52f951323622acf042ce0c91c29abd47fdf367f6800b9f95fc638319145b84a187524c2238664dba98df3aec3c91862f98bef3340436b400ab98784f9
7
+ data.tar.gz: 32b8c096395b9e65de1a5cf852ccf9bce850aad27f832aa9591fee35f02227e22e6d85a3780cb0368c502ef60bf0c3b041a4e8b782923fa61dcf105287eb44b4
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ShortCircuIt
4
- VERSION = "0.6.0.pre"
4
+ VERSION = "0.6.0.pre2"
5
5
  end
@@ -65,25 +65,22 @@ module ShortCircuIt
65
65
  # * database stuff *
66
66
  # => #<SomeAssociation:2468 id: 2>
67
67
  #
68
- # @param method_name [Symbol] The name of the method to be memoized
68
+ # @param *method_names [Symbol] The name(s) of one or more methods to be memoized
69
69
  # @param :observes [Symbol, Array<Symbol>]
70
70
  # A method or array of methods to be observed to determine memoization cache validity.
71
71
  # If any of the observed values change, the cached value will be invalidated.
72
72
  # By default, the object will observe itself.
73
- # @param :memoize_subclasses [Boolean]
74
- # If true, method will be memoized in subclasses that redefine the method.
75
- # If false, subclasses that redefine the method will not memoizee the resolveed value.
76
- # Default: false
77
- def memoize(method_name, observes: :itself, memoize_subclasses: false)
78
- add_memoized_observers(method_name.to_sym, observes)
73
+ def memoize(*method_names, observes: :itself)
74
+ method_names.map(&:to_sym).each do |method_name|
75
+ add_memoized_observers(method_name, observes)
79
76
 
80
- around_method(
81
- method_name.to_sym,
82
- prevent_double_wrapping_for: ShortCircuIt,
83
- wrap_subclasses: memoize_subclasses,
84
- ) do |*args|
85
- memoization_store.memoize(method_name.to_sym, args.hash) do
86
- super(*args)
77
+ around_method(
78
+ method_name,
79
+ prevent_double_wrapping_for: ShortCircuIt,
80
+ ) do |*args|
81
+ memoization_store.memoize(method_name, args.hash) do
82
+ super(*args)
83
+ end
87
84
  end
88
85
  end
89
86
  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.pre
4
+ version: 0.6.0.pre2
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-01-21 00:00:00.000000000 Z
11
+ date: 2019-03-12 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.pre
33
+ version: 0.6.0.pre2
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.pre
40
+ version: 0.6.0.pre2
41
41
  description: Memoize methods safely with parameter and dependency observation
42
42
  email:
43
43
  - allen.rettberg@freshly.com
@@ -70,8 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
70
70
  - !ruby/object:Gem::Version
71
71
  version: 1.3.1
72
72
  requirements: []
73
- rubyforge_project:
74
- rubygems_version: 2.7.6
73
+ rubygems_version: 3.0.3
75
74
  signing_key:
76
75
  specification_version: 4
77
76
  summary: Effortless memoization