Validation mixin for Ruby objects