Sha256: be76b2308e454ede692ce4a8bc6854784067cf2ba1d7bc72a513f7419b99a581

Contents?: true

Size: 975 Bytes

Versions: 16

Compression:

Stored size: 975 Bytes

Contents

module Csvlint
  module ErrorCollector
    attr_reader :errors, :warnings, :info_messages
    # Creates a validation error
    def build_errors(type, category = nil, row = nil, column = nil, content = nil, constraints = {})
      @errors << Csvlint::ErrorMessage.new(type, category, row, column, content, constraints)
    end
    # Creates a validation warning
    def build_warnings(type, category = nil, row = nil, column = nil, content = nil, constraints = {})
      @warnings << Csvlint::ErrorMessage.new(type, category, row, column, content, constraints)
    end
    # Creates a validation information message
    def build_info_messages(type, category = nil, row = nil, column = nil, content = nil, constraints = {})
      @info_messages << Csvlint::ErrorMessage.new(type, category, row, column, content, constraints)
    end

    def valid?
      errors.empty?
    end

    def reset
      @errors = []
      @warnings = []
      @info_messages = []
    end
  end
end

Version data entries

16 entries across 16 versions & 3 rubygems

Version Path
csvlint-1.0.0 lib/csvlint/error_collector.rb
csvlint-0.4.0 lib/csvlint/error_collector.rb
csvlint-0.3.3 lib/csvlint/error_collector.rb
csvlint-0.3.2 lib/csvlint/error_collector.rb
csvlint-0.3.1 lib/csvlint/error_collector.rb
csvlint-0.3.0 lib/csvlint/error_collector.rb
wjordan213-csvlint-0.2.8 lib/csvlint/error_collector.rb
wjordan213.csvlint-0.2.8 lib/csvlint/error_collector.rb
csvlint-0.2.6 lib/csvlint/error_collector.rb
csvlint-0.2.5 lib/csvlint/error_collector.rb
csvlint-0.2.4 lib/csvlint/error_collector.rb
csvlint-0.2.2 lib/csvlint/error_collector.rb
csvlint-0.2.1 lib/csvlint/error_collector.rb
csvlint-0.2.0 lib/csvlint/error_collector.rb
csvlint-0.1.4 lib/csvlint/error_collector.rb
csvlint-0.1.3 lib/csvlint/error_collector.rb