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.

Methods

doc   new   source   source_location  

Attributes

file  [R]  @return [String] The file where the module definition is located.
line  [R]  @return [Fixnum] The line where the module definition is located.

Public Class methods

@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`

Public Instance methods

@raise [Pry::CommandError] If documentation cannot be found. @return [String] The documentation for the candidate.

@raise [Pry::CommandError] If source code cannot be found. @return [String] The source for the candidate, i.e the

  complete module/class definition.

@return [Array, nil] A `[String, Fixnum]` pair representing the

  source location (file and line) for the candidate or `nil`
  if no source location found.

[Validate]