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