Skip to content

Add Struct#keyword_init? - #473

Merged
tannevaled merged 1 commit into
mainfrom
feat/cluster43
Aug 28, 2026
Merged

tannevaled merged 1 commit into
mainfrom
feat/cluster43

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Each Struct subclass minted by Struct.new now answers keyword_init? — true
or false when keyword_init: was passed, and nil when it was omitted (a
plain positional struct). It is a class method of the subclass only, so calling
it on Struct itself raises NoMethodError, as MRI does.

Verified against ruby 4.0.6. Whole-package coverage stays at 100%; the ruby/spec
ratchet floor rises 15840 → 15850 (core/struct/keyword_init 1 → 6, zero
regressions in a deterministic per-file sweep).

🤖 Generated with Claude Code

Each Struct subclass minted by Struct.new now answers keyword_init? — true or
false when keyword_init: was passed, and nil when it was omitted (a plain
positional struct). It is a class method of the subclass only, so calling it on
Struct itself raises NoMethodError, as MRI does.

Verified against ruby 4.0.6. Whole-package coverage stays at 100%; the ruby/spec
floor rises 15840 -> 15850 (core/struct/keyword_init 1 -> 6).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 1be723e into main Aug 28, 2026
7 checks passed
@tannevaled
tannevaled deleted the feat/cluster43 branch August 28, 2026 08:54
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

Successfully merging this pull request may close these issues.

1 participant