15 16 17 18 19 20
# File 'lib/dry/core/memoizable.rb', line 15 def inherited(base) super memoizer = base.ancestors.find { _1.is_a?(Memoizer) } base.prepend(memoizer.dup) if memoizer end
11 12 13
# File 'lib/dry/core/memoizable.rb', line 11 def memoize(*names) prepend(Memoizer.new(self, names)) end