From e2a7a747cf9e8d64944dc9c5ee9679064f811b8d Mon Sep 17 00:00:00 2001 From: Andrey Chernih Date: Mon, 11 Feb 2013 16:32:50 +0400 Subject: [PATCH] Update README.md --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 59c5d94..c1a0885 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,17 @@ Just extend with the Memoist module And person.social_security will only be calculated once. -You can even do it with a method that takes arguments. +Every memoized function (which initially was not accepting any arguments) has a ```(reload)``` +argument you can pass in to bypass and reset the memoization: + + def some_method + Time.now + end + memoize :some_method + +Calling ```some_method``` will be memoized, but calling ```some_method(true)``` will rememoize each time. + +You can even memoize method that takes arguments. class Person