VALIDATOR

Vision.

Instance validation is robustness.

Purpose.

The sole purpose of this DSL s to simplify the creation of validation libraries for the Ruby Programming Language.

Concept.

Being Ruby a dynamic programming language, it does not verify instance types per se. Even tough Ruby provides type verification mechanisms such as Duck Typing, exhaustive unit testing and methods like Object#is_a?, Object#instance_of?, Object#kind_of? and Object#respond_to?, it is require to write extra lines of code every time you require to validate any data instance.

Validator is a Domain Specific Language (DSL) written to address this lack of out-of-the-box functionality by simplifying the creation of validation libraries in Ruby.

Features.

The current version of this library implements these features:

  • Generic definition of group of classes, rules and conditions.

  • Generic Validator::Base class for creating user-defined Validation classes.

  • Registration of user-defined Validation classes.

  • Generic validations of instance with or without user-defined conditions.

  • Compatibility with Ruby interpreters version 1.8.x and 1.9.x.