how do you memoize a parametarized function in ruby?