Add memoized ruby method snippet