Module: Csvlint::ErrorCollector

Included in:
Field, Schema, Validator
Defined in:
lib/csvlint/error_collector.rb

Constant Summary collapse

MESSAGE_LEVELS =
[
  :errors,
  :warnings,
  :info_messages
]

Instance Method Summary collapse

Instance Method Details

#build_message(type, category, row, column, content, constraints) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/csvlint/error_collector.rb', line 5

def build_message(type, category, row, column, content, constraints)
  Csvlint::ErrorMessage.new({
                              :type => type,
                              :category => category,
                              :row => row,
                              :column => column,
                              :content => content,
                              :constraints => constraints
                            })
end

#resetObject



36
37
38
39
40
# File 'lib/csvlint/error_collector.rb', line 36

def reset
  MESSAGE_LEVELS.each do |level|
    instance_variable_set("@#{level}", [])
  end
end

#valid?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/csvlint/error_collector.rb', line 32

def valid?
  errors.empty?
end