Skip to content

Loading…

Update README.md to include memoization bypass description #6

Merged
merged 1 commit into from

2 participants

@andreychernih

No description provided.

@matthewrudy matthewrudy merged commit a7cbea7 into matthewrudy:master
@matthewrudy
Owner

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 11, 2013
  1. @andreychernih

    Update README.md

    andreychernih committed
Showing with 11 additions and 1 deletion.
  1. +11 −1 README.md
View
12 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
Something went wrong with that request. Please try again.