lib/json-schema/validator.rb
def validate
      @base_schema.validate(@data,[],self,@validation_options)

      if @options[:record_errors]
        if @options[:errors_as_objects]
          @errors.map{|e| e.to_hash}
        else
          @errors.map{|e| e.to_string}
        end
      else
        true
      end
    ensure
      if @validation_options[:clear_cache] == true
        self.class.clear_cache
      end
      if @validation_options[:insert_defaults]
        self.class.merge_missing_values(@data, @original_data)
      end
    end
def validate
      @base_schema.validate(@data,[],self,@validation_options)

      if @options[:record_errors]
        if @options[:errors_as_objects]
          @errors.map{|e| e.to_hash}
        else
          @errors.map{|e| e.to_string}
        end
      else
        true
      end
    ensure
      if @validation_options[:clear_cache] == true
        self.class.clear_cache
      end
      if @validation_options[:insert_defaults]
        self.class.merge_missing_values(@data, @original_data)
      end
    end
Run a simple true/false validation of data against a schema