Module: FitCommit::HasErrors
- Included in:
- Runner, Validators::Base
- Defined in:
- lib/fit-commit/has_errors.rb
Instance Method Summary collapse
- #add_error(lineno, message) ⇒ Object
- #add_warning(lineno, message) ⇒ Object
- #errors ⇒ Object
- #merge_errors(other_errors) ⇒ Object
- #merge_warnings(other_warnings) ⇒ Object
- #warnings ⇒ Object
Instance Method Details
#add_error(lineno, message) ⇒ Object
12 13 14 |
# File 'lib/fit-commit/has_errors.rb', line 12 def add_error(lineno, ) errors[lineno] += [] end |
#add_warning(lineno, message) ⇒ Object
16 17 18 |
# File 'lib/fit-commit/has_errors.rb', line 16 def add_warning(lineno, ) warnings[lineno] += [] end |
#errors ⇒ Object
4 5 6 |
# File 'lib/fit-commit/has_errors.rb', line 4 def errors @errors ||= Hash.new([]) end |
#merge_errors(other_errors) ⇒ Object
20 21 22 |
# File 'lib/fit-commit/has_errors.rb', line 20 def merge_errors(other_errors) merge_hashes(errors, other_errors) end |
#merge_warnings(other_warnings) ⇒ Object
24 25 26 |
# File 'lib/fit-commit/has_errors.rb', line 24 def merge_warnings(other_warnings) merge_hashes(warnings, other_warnings) end |
#warnings ⇒ Object
8 9 10 |
# File 'lib/fit-commit/has_errors.rb', line 8 def warnings @warnings ||= Hash.new([]) end |