Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/krzyzak/micro_validator
https://github.com/krzyzak/micro_validator
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/krzyzak/micro_validator
- Owner: krzyzak
- License: mit
- Created: 2013-07-30T08:25:05.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-08-06T11:11:39.000Z (over 11 years ago)
- Last Synced: 2023-03-13T11:35:53.303Z (almost 2 years ago)
- Language: Ruby
- Size: 148 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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```