-
-
Notifications
You must be signed in to change notification settings - Fork 230
-
-
Notifications
You must be signed in to change notification settings - Fork 230
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
Raise on non-existent key #171
Comments
@Fryguy You can use the validation, more details |
@aspirewit I'm not sure validations would work in every case. For example I have a configuration like this:
Now I might want to resolve:
|
+1 I would also love run-time errors on non-existent keys, something like a ENV.fetch |
https://github.com/obrok/closed_struct may be useful for implementing this. EDIT: it's also immutable, which is not so desired... |
Interesting, but I have no time to work on this at the moment... |
Another useful feature might be an option that instead of returning nil on a non-existent key, would instead raise an exception. I feel this could be similar to Hash#fetch.
cc @cben
The text was updated successfully, but these errors were encountered: