async-service 0.6.1 → 0.7.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: 2c5d89c7f841e6cbe16bad8337324981ef85f1da92d2a8b8acada2c12a51c91c
4
- data.tar.gz: 0fe963d6d034ce7b2c0644405fd2044cbd6645c61514d3be3698fdf0a2a52f7c
3
+ metadata.gz: 8715972e602d996a04c5d8ed36f765eab4e4eda85c5f978cd9d10b66dc48fee3
4
+ data.tar.gz: abd69a1148bcb121887aef3943a1a7fea9916d88c8d683ba25f1572a8f869bbb
5
5
  SHA512:
6
- metadata.gz: 86087e42a857958582c02812a59391378f6ba8a62beb49641a67d90db744c6007299926b5b0d41db0a13fc1cbf8fe498593a5e1c45e65f57fcd6e03ecdd4f4b6
7
- data.tar.gz: 17b9d71be9c88bcbbb52dfb0f15a75bf914062c757cfd4b4fbef058d83c99ea664495c58de3d7f3c6758438bb9d52fcf027124bbe8d6ad3e187c121e790e8827
6
+ metadata.gz: 9e9618479dab469fdc62db4058a25bbe2eccbc2b1c33a6b44af7b277eaa030220cd25dd5b8d720e51b2d964ecd525d123d4d423965920d2c79b4119714a866db
7
+ data.tar.gz: c018787aef323da8805c471cc59a5a4fcbe21c83f789fbbbdd24cc37ff6c9b619f58dba04cf023390469632e72f9ccadb00498ef82f9198e50d691612e523b10
checksums.yaml.gz.sig CHANGED
Binary file
@@ -78,16 +78,24 @@ module Async
78
78
 
79
79
  evaluator.include(facet)
80
80
 
81
+ keys = []
82
+
81
83
  # Memoize all instance methods:
82
84
  facet.instance_methods.each do |name|
83
- evaluator.define_method(name) do
84
- @cache[name] ||= super()
85
+ instance_method = facet.instance_method(name)
86
+
87
+ # Only memoize methods with no arguments:
88
+ if instance_method.arity == 0
89
+ keys << name
90
+
91
+ evaluator.define_method(name) do
92
+ @cache[name] ||= super()
93
+ end
85
94
  end
86
95
  end
87
96
 
88
- evaluator.define_method(:keys) do
89
- facet.instance_methods
90
- end
97
+ # This lists all zero-argument methods:
98
+ evaluator.define_method(:keys) {keys}
91
99
 
92
100
  return evaluator.new
93
101
  end
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Async
7
7
  module Service
8
- VERSION = "0.6.1"
8
+ VERSION = "0.7.0"
9
9
  end
10
10
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-service
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file