matthewrudy/memoist — pull request #18 by ryoqun (2014-06-02 02:47:58+00:00)
Title: Enable to set value to memoized method externally

Thanks for creating and maintaining this gem. :) We're currently evaluating to use this gem in our production code.

This pull request changes API. Namely it adds a new instance method called `set_cache`. This method can be used to set a memoized method to value from external.

In our code base, we need to assign the same value to huge number of objects at once in the batch processing for further manipulation of these objects.

In such a case, we would like to reuse the same object computed once at the entry point before the hot loop instead of repeatedly calling the memoized method for each and every objects.

So we'd like to have an official API to do that.