-
Notifications
You must be signed in to change notification settings - Fork 5
Poor Man's Type Checking in Arguments and Returns #35
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
base: master
Are you sure you want to change the base?
Conversation
14fcfb8 to
b1a771c
Compare
|
Not a review, but to answer some of your questions:
My idea originally was for it to be opt-in, since it has a runtime performance hit (not sure how much, but it's doing more work than before), and not everyone wants/likes strong typing.
I thought you'd do a |
9df0a6e to
29b670f
Compare
57b9c15 to
891a454
Compare
891a454 to
72440b9
Compare
|
@iovis WDYT? |
Please, disregard the branch name 😮💨
Changes
Add optional type checking to
argumentdeclarationsAdd optional type checking to
returnedvaluesNotes
Made them optional, since they're not the main purpose of the library, but happy to cut a 3.0.0 branch with breaking changes.
See each commit's README entries for more examples
About Collection validations
I've got a bit of a mess there. Not really sure I should check for Enumerable, or just
responds_to?(:each)is enough?Maybe having an optional
enumerates_with:key is cool to indicate which method is used to iterate the collection (default:each)?