class ActiveRecordDoctor::Error

Generic active_record_doctor exception class.

Attributes

config_path[RW]

Public Class Methods

[](*args) click to toggle source
# File lib/active_record_doctor/errors.rb, line 15
def self.[](*args)
  new(*args)
end

Public Instance Methods

details() click to toggle source
# File lib/active_record_doctor/errors.rb, line 19
def details
  nil
end
user_message() click to toggle source
# File lib/active_record_doctor/errors.rb, line 23
    def user_message
      result =
        <<-MESSAGE
active_record_doctor aborted due to the following error:
#{message}

Configuration file:
#{config_path_or_message}
        MESSAGE

      if details
        result << (
          <<-MESSAGE

Additional information:
#{details}
          MESSAGE
        )
      end

      result
    end

Private Instance Methods

config_path_or_message() click to toggle source
# File lib/active_record_doctor/errors.rb, line 48
def config_path_or_message
  @config_path || "no configuration file in use (using default settings)"
end
hyphenated_list(items) click to toggle source
# File lib/active_record_doctor/errors.rb, line 52
def hyphenated_list(items)
  items.map { |item| "  - #{item}" }.join("\n")
end