Class: Bundler::Thor::UndefinedCommandError::SpellChecker
- Inherits:
-
Object
- Object
- Bundler::Thor::UndefinedCommandError::SpellChecker
- Defined in:
- lib/bundler/vendor/thor/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.
31 32 33 |
# File 'lib/bundler/vendor/thor/lib/thor/error.rb', line 31 def initialize(error) @error = error end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
29 30 31 |
# File 'lib/bundler/vendor/thor/lib/thor/error.rb', line 29 def error @error end |
Instance Method Details
#corrections ⇒ Object
35 36 37 |
# File 'lib/bundler/vendor/thor/lib/thor/error.rb', line 35 def corrections @corrections ||= spell_checker.correct(error.command).map(&:inspect) end |
#spell_checker ⇒ Object
39 40 41 |
# File 'lib/bundler/vendor/thor/lib/thor/error.rb', line 39 def spell_checker NoKwargSpellChecker.new(error.all_commands) end |