Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve support for Sets in included_in? and excluded_from? predicates #483

Conversation

eriklovmo
Copy link
Contributor

@eriklovmo eriklovmo commented Dec 25, 2024

This pull request enhances support for using Set with the included_in? and excluded_from? predicates:

  • Update compiled error messages for sets. With this change, messages like "must be one of: 1, 3, 5" are produced instead of "must be one of: #<Set: {1, 3, 5}>". This makes the error clearer, especially when exposed to end users.
  • Add tests to demonstrate that Set is supported, as it responds to #include?.

Using sets is arguably more natural and efficient for membership checks, so explicitly supporting it makes sense.

@eriklovmo eriklovmo marked this pull request as ready for review December 25, 2024 20:59
@eriklovmo eriklovmo force-pushed the support-sets-for-inclusion-and-exclusion-predicates branch from cb13784 to ecef265 Compare December 26, 2024 09:35
@flash-gordon
Copy link
Member

Thanks, I merged this in 15d26d4

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.

2 participants