Exception: Rails::Command::CorrectableNameError
- Inherits:
-
StandardError
- Object
- StandardError
- Rails::Command::CorrectableNameError
- Includes:
- DidYouMean::Correctable
- Defined in:
- lib/rails/command.rb
Overview
:nodoc:
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #corrections ⇒ Object
-
#initialize(message, name, alternatives) ⇒ CorrectableNameError
constructor
A new instance of CorrectableNameError.
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(, name, alternatives) @name = name @alternatives = alternatives super() end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
18 19 20 |
# File 'lib/rails/command.rb', line 18 def name @name end |
Instance Method Details
#corrections ⇒ Object
29 30 31 |
# File 'lib/rails/command.rb', line 29 def corrections @corrections ||= DidYouMean::SpellChecker.new(dictionary: @alternatives).correct(name) end |