Repository navigation
Add Hash#key and Hash.ruby2_keywords_hash / ruby2_keywords_hash? - #470
Merged
Merged
Conversation
- Hash#key(value) returns the first key whose value equals value (by ==), or nil. - Hash.ruby2_keywords_hash(hash) returns a copy of hash flagged (via a new Ruby2Keywords field) as a keyword hash for *args forwarding, leaving the original unflagged; Hash.ruby2_keywords_hash? reports that flag. Both raise "wrong argument type X (expected Hash)" for a non-Hash argument. Verified against ruby 4.0.6. Whole-package coverage stays at 100%; the ruby/spec floor rises 15810 -> 15820 (core/hash key +3, ruby2_keywords_hash +5). Co-Authored-By: Claude Opus 4.8 <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.
Hash#key(value)returns the first key whose value equalsvalue(by==), ornil.Hash.ruby2_keywords_hash(hash)returns a copy ofhashflagged (via a newRuby2Keywordsfield) as a keyword hash for*argsforwarding, leaving theoriginal unflagged;
Hash.ruby2_keywords_hash?reports that flag. Bothraise
wrong argument type X (expected Hash)for a non-Hash argument.Verified against ruby 4.0.6. Whole-package coverage stays at 100%; the ruby/spec
ratchet floor rises 15810 → 15820 (
core/hashkey +3, ruby2_keywords_hash +5,zero regressions in a deterministic per-file sweep).
🤖 Generated with Claude Code