Class: Bundler::Thor::UnknownArgumentError::SpellChecker
- Inherits:
-
Object
- Object
- Bundler::Thor::UnknownArgumentError::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.
72 73 74 |
# File 'lib/bundler/vendor/thor/lib/thor/error.rb', line 72 def initialize(error) @error = error end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
70 71 72 |
# File 'lib/bundler/vendor/thor/lib/thor/error.rb', line 70 def error @error end |
Instance Method Details
#corrections ⇒ Object
76 77 78 79 |
# File 'lib/bundler/vendor/thor/lib/thor/error.rb', line 76 def corrections @corrections ||= error.unknown.flat_map { |unknown| spell_checker.correct(unknown) }.uniq.map(&:inspect) end |
#spell_checker ⇒ Object
81 82 83 |
# File 'lib/bundler/vendor/thor/lib/thor/error.rb', line 81 def spell_checker @spell_checker ||= NoKwargSpellChecker.new(error.switches) end |