Class: Gem::UnknownCommandSpellChecker

Inherits:
Object
  • Object
show all
Defined in:
lib/rubygems/unknown_command_spell_checker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error) ⇒ UnknownCommandSpellChecker

Returns a new instance of UnknownCommandSpellChecker.



6
7
8
# File 'lib/rubygems/unknown_command_spell_checker.rb', line 6

def initialize(error)
  @error = error
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



4
5
6
# File 'lib/rubygems/unknown_command_spell_checker.rb', line 4

def error
  @error
end

Instance Method Details

#correctionsObject



10
11
12
13
# File 'lib/rubygems/unknown_command_spell_checker.rb', line 10

def corrections
  @corrections ||=
    spell_checker.correct(error.unknown_command).map(&:inspect)
end