Skip to content

Add union variant convenience methods - #121

Merged
kylekthompson merged 3 commits into
mainfrom
union-variant-conveniences
Aug 21, 2026
Merged

Add union variant convenience methods#121
kylekthompson merged 3 commits into
mainfrom
union-variant-conveniences

Conversation

@kylekthompson

Copy link
Copy Markdown
Owner

Summary

  • generate class-level constructors for each Strict::Union variant
  • generate instance interrogation methods and reject method-name collisions
  • document the convenience API and prepare version 2.1.0

Testing

  • bundle exec rake
  • bundle exec gem build strict.gemspec --output /tmp/strict-2.1.0.gem

Make variants easy to construct and interrogate without naming generated classes or using pattern matching. Reject naming collisions so generated checks stay reliable.

Amp-Thread-ID: https://ampcode.com/threads/T-01a02275-fa92-77ec-b917-0ea0ab7d9704
Show the generated constructors and interrogation methods, including their naming and collision constraints.

Amp-Thread-ID: https://ampcode.com/threads/T-01a02275-fa92-77ec-b917-0ea0ab7d9704
Bump the gem and lockfile versions and move the union convenience API notes into a dated release section.

Amp-Thread-ID: https://ampcode.com/threads/T-01a02275-fa92-77ec-b917-0ea0ab7d9704
@kylekthompson
kylekthompson force-pushed the union-variant-conveniences branch from 496135a to 4b8b3a7 Compare August 21, 2026 04:07
@kylekthompson
kylekthompson marked this pull request as ready for review August 21, 2026 04:07
@kylekthompson
kylekthompson enabled auto-merge (squash) August 21, 2026 04:07
@kylekthompson
kylekthompson merged commit 8eb6a8c into main Aug 21, 2026
4 checks passed
@kylekthompson
kylekthompson deleted the union-variant-conveniences branch August 21, 2026 04:08
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