Announcing the first release of Ducktator, a Duck Type validator.
Ducktator is a small library to enable Ruby systems to generically
validate objects introspectively. In plain speak, check certain common
methods of objects, and see if they match what your schema expects the
values to be. This capability is not necessary for most applications,
but sometimes it’s highly useful. For example, validating objects that
have been serialized or marshallad. Validating what you get when
loading YAML files, so that the object graph matches what your code
does. Write test cases that expect a complicated object back. The
possibilities are many.
Ducktator can be configured either with YAML or directly using simple
Hashes. The syntax is very recursive, extensible and easy. I will use
YAML for the examples in this document, but for easier validations it
may be better just creating the +Hash+ directly.
The project resides at http://rubyforge.org/projects/ducktator
It can be installed by gems:
gem install ducktator
More information can be found in the RDoc and README, and here:
“Yields falsehood when quined” yields falsehood when quined.