class Schash::Validator

Public Class Methods

new(&schema_block) click to toggle source
# File lib/schash/validator.rb, line 3
def initialize(&schema_block)
  @validator = Schema::Rule::Hash.new(Schema::DSL.evaluate(&schema_block))
end

Public Instance Methods

validate(target) click to toggle source
# File lib/schash/validator.rb, line 7
def validate(target)
  @validator.validate(target)
end