Method: Fast.build_grouped_search
- Defined in:
- lib/fast.rb
.build_grouped_search(method_name, pattern, on_result) ⇒ Proc
Returns binding ‘pattern` argument from a given `method_name`.
213 214 215 216 217 218 219 220 221 222 |
# File 'lib/fast.rb', line 213 def build_grouped_search(method_name, pattern, on_result) search_pattern = method(method_name).curry.call(pattern) proc do |file| results = search_pattern.call(file) next if results.nil? || results.empty? on_result&.(file, results) { file => results } end end |