Include Memoizable alone with an #initialize_copy method that will copy the memoization cache when dup or clone is used.
TODO: Is this best approach? Perhaps a method to easily create the #initialize_copy method would suffice?
# File lib/supplemental/facets/memoizable.rb, line 128 def self.included(base) base.extend(Memoizable) end
# File lib/supplemental/facets/memoizable.rb, line 133 def initialize_copy(original) if Memoizable.cache.key?(original) Memoizable.cache[self] = Memoizable.cache[original].dup end end