Class: Jets::Command::Base::CorrectableError

Inherits:
Error
  • Object
show all
Includes:
DidYouMean::Correctable
Defined in:
lib/jets/command/base.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message, key, options) ⇒ CorrectableError

Returns a new instance of CorrectableError.



22
23
24
25
26
# File 'lib/jets/command/base.rb', line 22

def initialize(message, key, options)
  @key     = key
  @options = options
  super(message)
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



20
21
22
# File 'lib/jets/command/base.rb', line 20

def key
  @key
end

#optionsObject (readonly)

Returns the value of attribute options.



20
21
22
# File 'lib/jets/command/base.rb', line 20

def options
  @options
end

Instance Method Details

#correctionsObject



31
32
33
# File 'lib/jets/command/base.rb', line 31

def corrections
  @corrections ||= DidYouMean::SpellChecker.new(dictionary: options).correct(key)
end