Class: Thor::UndefinedCommandError::SpellChecker
- Inherits:
-
Object
- Object
- Thor::UndefinedCommandError::SpellChecker
- Defined in:
- lib/thor/error.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
Instance Method Summary collapse
- #corrections ⇒ Object
-
#initialize(error) ⇒ SpellChecker
constructor
A new instance of SpellChecker.
- #spell_checker ⇒ Object
Constructor Details
#initialize(error) ⇒ SpellChecker
Returns a new instance of SpellChecker.
28 29 30 |
# File 'lib/thor/error.rb', line 28 def initialize(error) @error = error end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
26 27 28 |
# File 'lib/thor/error.rb', line 26 def error @error end |
Instance Method Details
#corrections ⇒ Object
32 33 34 |
# File 'lib/thor/error.rb', line 32 def corrections @corrections ||= spell_checker.correct(error.command).map(&:inspect) end |
#spell_checker ⇒ Object
36 37 38 |
# File 'lib/thor/error.rb', line 36 def spell_checker DidYouMean::SpellChecker.new(dictionary: error.all_commands) end |