Class: RDoc::RI::Driver::NotFoundError

Inherits:
Error
  • Object
show all
Defined in:
lib/rdoc/ri/driver.rb

Overview

Raised when a name isn't found in the ri data stores

Instance Method Summary collapse

Constructor Details

#initialize(klass, suggestion_proc = nil) ⇒ NotFoundError

:nodoc:



39
40
41
42
# File 'lib/rdoc/ri/driver.rb', line 39

def initialize(klass, suggestion_proc = nil) # :nodoc:
  @klass = klass
  @suggestion_proc = suggestion_proc
end

Instance Method Details

#message ⇒ Object

:nodoc:



51
52
53
54
55
56
57
58
# File 'lib/rdoc/ri/driver.rb', line 51

def message # :nodoc:
  str = "Nothing known about #{@klass}"
  suggestions = @suggestion_proc&.call
  if suggestions and !suggestions.empty?
    str += "\nDid you mean?  #{suggestions.join("\n               ")}"
  end
  str
end

#name ⇒ Object

Name that wasn't found



47
48
49
# File 'lib/rdoc/ri/driver.rb', line 47

def name
  @klass
end