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

Public API for @_memo? #226

Closed
sirscriptalot opened this issue Nov 1, 2017 · 0 comments
Closed

Public API for @_memo? #226

sirscriptalot opened this issue Nov 1, 2017 · 0 comments

Comments

@sirscriptalot
Copy link

Hi all,

I was curious what you all thought about making an accessor for @_memo? I personally use it to memoize expensive methods and finders like what is done internally with references. It isn't too important, I just feel a little uncomfortable depending on a private variable like I am and also don't like patching reload_attributes to add a new hash that does the same thing as memo.

Thinking through some of the negatives, I noticed ohm-crystal doesn't memoize associations and maybe that is something you'd want to remove from ohm (ruby) as well? Also, I suppose users could clobber the existing memo keys unintentionally. I don't think it's worth it to update the reference helper to namespace associations on the memo hash, that seems like a user error if someone is using the same keys.

@sirscriptalot sirscriptalot changed the title Public API for @_memo Public API for @_memo? Nov 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant