Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

..
Failed to load latest commit information.
README.rb

README.rb

# coding: us-ascii

$VERBOSE = true

require_relative '../lib/struct/validatable'

Person = Struct.new :name do
  validator :name, AND(String, /\w+/)
end

person = Person.new
#person.name = ''         #=> error
person.name = 'Foo Bar'
p person.valid?(:name) #=> true
p person
person.name.clear
p person.valid?(:name) #=> false
p person
Something went wrong with that request. Please try again.