Hval 🐳
Hval is a Hash Validation gem.
Installation
Not available in rubygems (yet) so you can clone the repo and build the gem from source.
$ gem build hval.gemspec
$ gem install hval-0.1.0.gem
Usage
schema = {name: {type?: String, format?: /brush/}, age: {type?: Integer }
validator = Hval::Validator.new(schema)
validator.call({name: "guybrush", age: 45})
validator.valid?
=> true
Development
Hval is swimming under water, and will suffer a lot of changes. The gem approach is very naive and not fully tested, so if you
use it be carefull. Critics, fixes, suggestions are more than welcome.
Todo
- Return errors with messages and in a friendly format. Now, the return of the #call method return information about the result of the validation.
License
The gem is available as open source under the terms of the MIT License.
Code of Conduct
Everyone interacting in the Hval project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.