def run(cookbook, options = {})
      log.info("Running validations for `#{klass.id}.#{id}'")

      inside(cookbook) do
        instance = klass.new(cookbook, options)
        unless result = instance.instance_eval(&block)
          log.debug("Validation failed, result: #{result.inspect}")

          # Convert the class and id to their magical equivalents
          error = Error.const_get("#{Util.camelize(klass.id)}#{Util.camelize(id)}ValidationFailed")
          raise error.new(path: Dir.pwd, result: result)
        end
      end

      log.debug("Validation #{id} passed!")
    end
def run(cookbook, options = {})
      log.info("Running validations for `#{klass.id}.#{id}'")

      inside(cookbook) do
        instance = klass.new(cookbook, options)
        unless result = instance.instance_eval(&block)
          log.debug("Validation failed, result: #{result.inspect}")

          # Convert the class and id to their magical equivalents
          error = Error.const_get("#{Util.camelize(klass.id)}#{Util.camelize(id)}ValidationFailed")
          raise error.new(path: Dir.pwd, result: result)
        end
      end

      log.debug("Validation #{id} passed!")
    end
Create a new validator object.

 @param [~Class] klass
   the class that created this validator
 @param [Symbol] id
   the identifier or field this validator runs against
 @param [Proc] block
   the block to execute to see if the validation passes


 Execute this validation in the context of the creating class, inside the
 given cookbook's path.

 @param [Cookbook]
   the cookbook to run this validation against