Module: Csvlint::ErrorCollector
- Included in:
- Csvw::Column, Csvw::Table, Csvw::TableGroup, Field, Schema, Validator
- Defined in:
- lib/csvlint/error_collector.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#info_messages ⇒ Object
readonly
Returns the value of attribute info_messages.
-
#warnings ⇒ Object
readonly
Returns the value of attribute warnings.
Instance Method Summary collapse
-
#build_errors(type, category = nil, row = nil, column = nil, content = nil, constraints = {}) ⇒ Object
Creates a validation error.
-
#build_info_messages(type, category = nil, row = nil, column = nil, content = nil, constraints = {}) ⇒ Object
Creates a validation information message.
-
#build_warnings(type, category = nil, row = nil, column = nil, content = nil, constraints = {}) ⇒ Object
Creates a validation warning.
- #reset ⇒ Object
- #valid? ⇒ Boolean
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
3 4 5 |
# File 'lib/csvlint/error_collector.rb', line 3 def errors @errors end |
#info_messages ⇒ Object (readonly)
Returns the value of attribute info_messages.
3 4 5 |
# File 'lib/csvlint/error_collector.rb', line 3 def end |
#warnings ⇒ Object (readonly)
Returns the value of attribute warnings.
3 4 5 |
# File 'lib/csvlint/error_collector.rb', line 3 def warnings @warnings end |
Instance Method Details
#build_errors(type, category = nil, row = nil, column = nil, content = nil, constraints = {}) ⇒ Object
Creates a validation error
5 6 7 |
# File 'lib/csvlint/error_collector.rb', line 5 def build_errors(type, category = nil, row = nil, column = nil, content = nil, constraints = {}) @errors << Csvlint::ErrorMessage.new(type, category, row, column, content, constraints) end |
#build_info_messages(type, category = nil, row = nil, column = nil, content = nil, constraints = {}) ⇒ Object
Creates a validation information message
15 16 17 |
# File 'lib/csvlint/error_collector.rb', line 15 def (type, category = nil, row = nil, column = nil, content = nil, constraints = {}) << Csvlint::ErrorMessage.new(type, category, row, column, content, constraints) end |
#build_warnings(type, category = nil, row = nil, column = nil, content = nil, constraints = {}) ⇒ Object
Creates a validation warning
10 11 12 |
# File 'lib/csvlint/error_collector.rb', line 10 def build_warnings(type, category = nil, row = nil, column = nil, content = nil, constraints = {}) @warnings << Csvlint::ErrorMessage.new(type, category, row, column, content, constraints) end |
#reset ⇒ Object
23 24 25 26 27 |
# File 'lib/csvlint/error_collector.rb', line 23 def reset @errors = [] @warnings = [] = [] end |
#valid? ⇒ Boolean
19 20 21 |
# File 'lib/csvlint/error_collector.rb', line 19 def valid? errors.empty? end |