Module: Csvlint::ErrorCollector
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
- #build_info_messages(type, category = nil, row = nil, column = nil, content = nil, constraints = {}) ⇒ Object
- #build_warnings(type, category = nil, row = nil, column = nil, content = nil, constraints = {}) ⇒ Object
- #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
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
11 12 13 |
# File 'lib/csvlint/error_collector.rb', line 11 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
8 9 10 |
# File 'lib/csvlint/error_collector.rb', line 8 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
19 20 21 22 23 |
# File 'lib/csvlint/error_collector.rb', line 19 def reset @errors = [] @warnings = [] = [] end |
#valid? ⇒ Boolean
15 16 17 |
# File 'lib/csvlint/error_collector.rb', line 15 def valid? errors.empty? end |