module DidYouMean::Correctable

Public Instance Methods

corrections() click to toggle source
# File lib/did_you_mean/core_ext/name_error.rb, line 19
def corrections
  @corrections ||= spell_checker.corrections
end
original_message() click to toggle source
# File lib/did_you_mean/core_ext/name_error.rb, line 3
def original_message
  method(:to_s).super_method.call
end
spell_checker() click to toggle source
# File lib/did_you_mean/core_ext/name_error.rb, line 23
def spell_checker
  SPELL_CHECKERS[self.class.to_s].new(self)
end
to_s() click to toggle source
Calls superclass method
# File lib/did_you_mean/core_ext/name_error.rb, line 7
def to_s
  msg = super.dup

  if !cause.respond_to?(:corrections) || cause.corrections.empty?
    msg << DidYouMean.formatter.message_for(corrections)
  end

  msg
rescue
  super
end