File: validator.rb

package info (click to toggle)
ruby-schash 0.1.2%2Bgh-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 164 kB
  • sloc: ruby: 325; sh: 3; makefile: 3
file content (12 lines) | stat: -rw-r--r-- 232 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
module Schash
  class Validator
    def initialize(&schema_block)
      @validator = Schema::Rule::Hash.new(Schema::DSL.evaluate(&schema_block))
    end

    def validate(target)
      @validator.validate(target)
    end
  end
end