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

#clear_errorsObject



28
29
30
# File 'lib/fit_commit/has_errors.rb', line 28

def clear_errors
  @errors = Hash.new([])
end

#clear_warningsObject



32
33
34
# File 'lib/fit_commit/has_errors.rb', line 32

def clear_warnings
  @warnings = Hash.new([])
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