lotus/validations — pull request #13 by rail44 (2014-09-11 10:14:05+00:00)
Title: Add block validation for attributes

Hi.

This bling block validation, like

```
class BlockValidation
include Lotus::Validations

attribute :name do |value|
case value
when 'foo'
true
when 'bar'
[true, 'FOO']
else
[false, 'foo or bar']
end
end
end
```

The block will receive attribute's value for first argument.
It is expected to have 1~2 return value. `[Boolean, (Object)]`
First one tell whether value is valid or not.
If `true`, it will replace value with second return value like `type` validation.
If `false`, it will set second value to `errors`'s `expected`.

Thank you.