define schemas as a hash, and validate hashes!
require 'hashidator'
schema = {:name => String, :age => Integer}
valid = {:name => "Harry", :age => 20}
invalid = {:name => 1234, :age => "twenty"}
h = Hashidator.new(schema)
h.validate(valid) #=> true
h.validate(invalid) #=> false
see examples/basic.rb for full coverage. it knows classes, ranges, booleans, proc and duck typing. yay!
© 2009 harry vangberg <[email protected]>,
peter suschlik <peter@suschlik.de>
distributed under the mit license. google it.