Module: FitCommit::HasErrors

Included in:
Runner, Validators::Base
Defined in:
lib/fit-commit/has_errors.rb

Instance Method Summary collapse

Instance Method Details

#add_error(lineno, message) ⇒ Object



12
13
14
# File 'lib/fit-commit/has_errors.rb', line 12

def add_error(lineno, message)
  errors[lineno] += [message]
end

#add_warning(lineno, message) ⇒ Object



16
17
18
# File 'lib/fit-commit/has_errors.rb', line 16

def add_warning(lineno, message)
  warnings[lineno] += [message]
end

#errorsObject



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

#warningsObject



8
9
10
# File 'lib/fit-commit/has_errors.rb', line 8

def warnings
  @warnings ||= Hash.new([])
end