Class: Rails::Command::Base::CorrectableError
- Includes:
- DidYouMean::Correctable
- Defined in:
- lib/rails/command/base.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #corrections ⇒ Object
-
#initialize(message, key, options) ⇒ CorrectableError
constructor
A new instance of CorrectableError.
Constructor Details
#initialize(message, key, options) ⇒ CorrectableError
Returns a new instance of CorrectableError.
20 21 22 23 24 |
# File 'lib/rails/command/base.rb', line 20 def initialize(, key, ) @key = key @options = super() end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
18 19 20 |
# File 'lib/rails/command/base.rb', line 18 def key @key end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
18 19 20 |
# File 'lib/rails/command/base.rb', line 18 def @options end |
Instance Method Details
#corrections ⇒ Object
29 30 31 |
# File 'lib/rails/command/base.rb', line 29 def corrections @corrections ||= DidYouMean::SpellChecker.new(dictionary: ).correct(key) end |