Skip to content

Add Struct.new and Data.define support#438

Merged
mame merged 1 commit intomasterfrom
struct-new
Apr 20, 2026
Merged

Add Struct.new and Data.define support#438
mame merged 1 commit intomasterfrom
struct-new

Conversation

@mame
Copy link
Copy Markdown
Member

@mame mame commented Apr 20, 2026

Recognize Foo = Struct.new(:bar, :baz) and Foo = Data.define(:x, :y) patterns and generate appropriate class definitions with:

  • attr_reader for all members
  • attr_writer for Struct members (Data is frozen)
  • initialize with positional args (Struct) or keyword args (Data)
  • Block body support for additional method definitions

Recognize `Foo = Struct.new(:bar, :baz)` and `Foo = Data.define(:x, :y)`
patterns and generate appropriate class definitions with:
- attr_reader for all members
- attr_writer for Struct members (Data is frozen)
- initialize with positional args (Struct) or keyword args (Data)
- Block body support for additional method definitions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mame mame enabled auto-merge (rebase) April 20, 2026 11:11
@mame mame merged commit 6f94f26 into master Apr 20, 2026
12 checks passed
@mame mame deleted the struct-new branch April 20, 2026 11:12
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