Permalink
Browse files

Merge pull request #6 from AndreyChernyh/patch-1

Update README.md to include memoization bypass description
  • Loading branch information...
matthewrudy committed Feb 11, 2013
2 parents d0f1818 + e2a7a74 commit a7cbea72986564ad3e517d5caf67918d07c45396
Showing with 11 additions and 1 deletion.
  1. +11 −1 README.md
View
@@ -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

0 comments on commit a7cbea7

Please sign in to comment.