validation

Build Status Gem Version Dependency Status

Description

Validations with Ruby objects.

Features

  • Pure Ruby :)

Usage

How to build flexible conditions

An optional extension for accessor with validation.

```ruby require ‘validation’

class Person include Validation

attr_validator :name, String attr_validator :id, OR(nil, AND(Integer, 1..100)) end

person = Person.new person.name = :Ken #=> Error (Symbol is not String) person.id = 200 #=> Error (200 is not covered by 1..100) person.name = ‘Ken’ #=> Pass person.id = 1 #=> Pass ```

More Examples

Requirements

Install

bash gem install validation

License

The MIT X11 License
Copyright (c) 2011-2012 Kenichi Kamiya
See MIT-LICENSE for further details.