Add memoization groups (group: option) for v1.5.0#60
Merged
Conversation
…1.5.0) - `memoize :method, group: :name` tags a method with a named invalidation group - `reset_memo_group(group)` on instances clears all per-instance entries for the group - `reset_shared_memo_group(group)` on the class clears shared-cache entries for the group - `memo_group_methods(group)` / `memo_groups` for instance-level introspection - `safe_memo_group_methods(group)` / `safe_memo_groups` for class-level introspection - `group:` accepted by `safe_memoize_options` as a class-wide default - A method belongs to at most one group; re-memoizing with a different group moves it - 22 new tests, 100% line coverage maintained Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Update CHANGELOG, ROADMAP, and README for the group: option, reset_memo_group, reset_shared_memo_group, and related introspection methods. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
group:option tomemoize— tags a method with a named invalidation group so related methods can be busted in one operationreset_memo_group(group_name)instance method clears all per-instance cached entries for every method in the group;reset_shared_memo_group(group_name)is the class-level equivalent forshared: truemethodsmemo_groups,memo_group_methods(group_name)on instances;safe_memo_groups,safe_memo_group_methods(group_name)on the classgroup:is accepted bysafe_memoize_optionsas a class-wide defaultgroup:moves itTest plan
bundle exec rake— 833 examples, 0 failures, 100% line coverage, lint cleansafe_memoize_optionsintegration,on_evicthook fires on group reset🤖 Generated with Claude Code