module FitCommit::HasErrors

Public Instance Methods

add_error(lineno, message) click to toggle source
# File lib/fit_commit/has_errors.rb, line 12
def add_error(lineno, message)
  errors[lineno] += [message]
end
add_warning(lineno, message) click to toggle source
# File lib/fit_commit/has_errors.rb, line 16
def add_warning(lineno, message)
  warnings[lineno] += [message]
end
clear_errors() click to toggle source
# File lib/fit_commit/has_errors.rb, line 28
def clear_errors
  @errors = Hash.new([])
end
clear_warnings() click to toggle source
# File lib/fit_commit/has_errors.rb, line 32
def clear_warnings
  @warnings = Hash.new([])
end
errors() click to toggle source
# File lib/fit_commit/has_errors.rb, line 4
def errors
  @errors ||= Hash.new([])
end
merge_errors(other_errors) click to toggle source
# File lib/fit_commit/has_errors.rb, line 20
def merge_errors(other_errors)
  merge_hashes(errors, other_errors)
end
merge_warnings(other_warnings) click to toggle source
# File lib/fit_commit/has_errors.rb, line 24
def merge_warnings(other_warnings)
  merge_hashes(warnings, other_warnings)
end
warnings() click to toggle source
# File lib/fit_commit/has_errors.rb, line 8
def warnings
  @warnings ||= Hash.new([])
end

Private Instance Methods

merge_hashes(error_hash, other_hash) click to toggle source
# File lib/fit_commit/has_errors.rb, line 38
def merge_hashes(error_hash, other_hash)
  error_hash.merge!(other_hash) do |_lineno, messages, other_messages|
    messages + other_messages
  end
end