class Gem::UnknownCommandError - Documentation for Ruby 4.0
Description: Documentation for the Gem::UnknownCommandError class
Keywords: ruby,class,Gem::UnknownCommandError

🔍

No recent searches

# class Gem::UnknownCommandError

### Attributes

unknown_command [R]

### Public Class Methods

attach_correctable ()
Source

    # File lib/rubygems/exceptions.rb, line 22
    def self.attach_correctable
      return if method_defined?(:corrections)

      if defined?(DidYouMean) && DidYouMean.respond_to?(:correct_error)
        DidYouMean.correct_error(Gem::UnknownCommandError, Gem::UnknownCommandSpellChecker)
      end
    end

new (unknown_command)
Source

    # File lib/rubygems/exceptions.rb, line 15
    def initialize(unknown_command)
      self.class.attach_correctable

      @unknown_command = unknown_command
      super("Unknown command #{unknown_command}")
    end

Calls superclass method `Exception::new`