Class | Pry::WrappedModule::Candidate |
In: |
lib/pry/module_candidate.rb
|
Parent: | Object |
This class represents a single candidate for a module/class definition. It provides access to the source, documentation, line and file for a monkeypatch (reopening) of a class/module.
file | [R] | @return [String] The file where the module definition is located. |
line | [R] | @return [Fixnum] The line where the module definition is located. |
@raise [Pry::CommandError] If `rank` is out of bounds. @param [Pry::WrappedModule] wrapper The associated
`Pry::WrappedModule` instance that owns the candidates.
@param [Fixnum] rank The rank of the candidate to
retrieve. Passing 0 returns 'primary candidate' (the candidate with largest number of methods), passing 1 retrieves candidate with second largest number of methods, and so on, up to `Pry::WrappedModule#number_of_candidates() - 1`
@raise [Pry::CommandError] If documentation cannot be found. @return [String] The documentation for the candidate.
@return [Array, nil] A `[String, Fixnum]` pair representing the
source location (file and line) for the candidate or `nil` if no source location found.