Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/krzyzak/micro_validator


https://github.com/krzyzak/micro_validator

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

µValidator
===============

Zero dependency, dead simple validation library.

Usage
========

```
require "micro_validator"

class Foo
validate :bar
validate :baz

private
def bar
errors.add(:attribute, "Attribute is wrong") if attribute == "Wrong"
end

def baz
false # Always fails
end
end

@foo = Foo.new
@foo.valid? # => false

```