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

Should Any#contains? be Any::includes? #85

Open
HCLarsen opened this issue Jan 4, 2025 · 0 comments
Open

Should Any#contains? be Any::includes? #85

HCLarsen opened this issue Jan 4, 2025 · 0 comments

Comments

@HCLarsen
Copy link
Contributor

HCLarsen commented Jan 4, 2025

There's a method in Any called contains?, and it's essentially a wrapper for the includes? method if the underlying value is an Array or String. Replacing it with a method called includes? would make this far more consistent with the core library.

It also returns a false value if the underlying object isn't an Array or String. Is this the best behaviour, or should it raise an exception in this situation?

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

No branches or pull requests

1 participant