Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md to include memoization bypass description #6

Merged
merged 1 commit into from Feb 11, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 11 additions & 1 deletion README.md
Expand Up @@ -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
Expand Down