RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

Validate keys of hash using assert_valid_keys 🚧

Have you heard of the assert_valid_keys method for the Hash class in Rails?

This method provides an easy way to validate the keys of a hash against a list of expected keys. It raises an error if the hash contains any keys that are not included in the expected list -

https://rishi.tips/t/assert-valid-keys/

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in