-
Notifications
You must be signed in to change notification settings - Fork 13
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
Memoize methods that depend on instance state automatically #9
Comments
I like this change. We have to communicate methods need to be present / changed before Correct: class Foo
include Adamantium, Equalizer.new(:foo)
end Incorrect: class Foo
include Equalizer.new(:foo), Adamantium
end
|
@mbj sure, the first thing we could do show examples using |
I just remember a chat conversation in |
An immutable object's state never changes, so the
#hash
,#inspect
and#to_s
methods are idempotent. These methods should be memoized by default.The text was updated successfully, but these errors were encountered: