Class | Pry::WrappedModule |
In: |
lib/pry/wrapped_module.rb
lib/pry/module_candidate.rb |
Parent: | Object |
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")
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).
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
Get the instance associated with this singleton class.
@raise ArgumentError: tried to get instance of non singleton class
@return [Object]
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.