Exception: Rails::Command::CorrectableNameError

Inherits:
StandardError
  • Object
show all
Includes:
DidYouMean::Correctable
Defined in:
lib/rails/command.rb

Overview

:nodoc:

Direct Known Subclasses

UnrecognizedCommandError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, name, alternatives) ⇒ CorrectableNameError

Returns a new instance of CorrectableNameError.



20
21
22
23
24
# File 'lib/rails/command.rb', line 20

def initialize(message, name, alternatives)
  @name = name
  @alternatives = alternatives
  super(message)
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



18
19
20
# File 'lib/rails/command.rb', line 18

def name
  @name
end

Instance Method Details

#correctionsObject



35
36
37
# File 'lib/rails/command.rb', line 35

def corrections
  @corrections ||= DidYouMean::SpellChecker.new(dictionary: @alternatives).correct(name)
end

#detailed_messageObject



27
28
29
# File 'lib/rails/command.rb', line 27

def detailed_message(...)
  message
end