Class Pry::WrappedModule
In: lib/pry/wrapped_module.rb
lib/pry/module_candidate.rb
Parent: Object

Methods

Included Modules

Pry::Helpers::DocumentationHelpers

Classes and Modules

Class Pry::WrappedModule::Candidate

Public Class methods

Convert a string to a module.

@param [String] mod_name @param [Binding] target The binding where the lookup takes place. @return [Module, nil] The module or `nil` (if conversion failed). @example

  Pry::WrappedModule.from_str("Pry::Code")

@raise [ArgumentError] if the argument is not a `Module` @param [Module] mod

Public Instance methods

Return a candidate for this module of specified rank. A `rank` of 0 is equivalent to the ‘primary candidate’, which is the module definition with the highest number of methods. A `rank` of 1 is the module definition with the second highest number of methods, and so on. Module candidates are necessary as modules can be reopened multiple times and in multiple places in Ruby, the candidate API gives you access to the module definition representing each of those reopenings. @raise [Pry::CommandError] If the `rank` is out of range. That

  is greater than `number_of_candidates - 1`.

@param [Fixnum] rank @return [Pry::WrappedModule::Candidate]

Returns documentation for the module. This documentation is for the primary candidate, if you would like documentation for other candidates use `WrappedModule#candidate` to select the candidate you‘re interested in. @raise [Pry::CommandError] If documentation cannot be found. @return [String] The documentation for the module.

@return [String, nil] The associated file for the module (i.e

  the primary candidate: highest ranked monkeypatch).

@return [Fixnum, nil] The associated line for the module (i.e

  the primary candidate: highest ranked monkeypatch).

Forward method invocations to the wrapped module

The prefix that would appear before methods defined on this class.

i.e. the "String." or "String#" in String.new and String#initialize.

@return String

The name of the Module if it has one, otherwise #<Class:0xf00>.

@return [String]

@return [Fixnum] The number of candidate definitions for the

  current module.

Is this a singleton class? @return [Boolean]

Get the instance associated with this singleton class.

@raise ArgumentError: tried to get instance of non singleton class

@return [Object]

Returns the source for the module. This source is for the primary candidate, if you would like source for other candidates use `WrappedModule#candidate` to select the candidate you‘re interested in. @raise [Pry::CommandError] If source cannot be found. @return [String] The source for the module.

source_file()

Alias for file

source_line()

Alias for line

Retrieve the source location of a module. Return value is in same format as Method#source_location. If the source location cannot be found this method returns `nil`.

@param [Module] mod The module (or class). @return [Array<String, Fixnum>, nil] The source location of the

  module (or class), or `nil` if no source location found.

@return [String] Return the YARD docs for this module.

@return [Boolean] Whether YARD docs are available for this module.

@return [String] Return the associated file for the

  module from YARD, if one exists.

@return [Fixnum] Return the associated line for the

  module from YARD, if one exists.

[Validate]