Class Pry::Command::CodeCollector
In: lib/pry/commands/code_collector.rb
Parent: Object

Methods

Included Modules

Helpers::CommandHelpers

Attributes

_pry_  [R] 
args  [R] 
file  [RW]  The name of the explicitly given file (if any).
input_expression_ranges  [RW] 
opts  [R] 
output_result_ranges  [RW] 

Public Class methods

Add the `—lines`, `-o`, `-i`, `-s`, `-d` options.

Public Instance methods

The content (i.e code/docs) for the selected object. If the user provided a bare code object, it returns the source. If the user provided the `-i` or `-o` switches, it returns the selected input/output lines joined as a string. If the user used `-d CODE_OBJECT` it returns the docs for that code object.

@return [String]

The line range passed to `—lines`, converted to a 0-indexed range.

Name of the object argument

The selected `pry.input_array` as a string, as specified by the `-i` switch.

@return [String]

The selected `pry.output_array` as a string, as specified by the `-o` switch.

@return [String]

Given a string and a range, return the `range` lines of that string.

@param [String] content @param [Range, Fixnum] range @return [String] The string restricted to the given range

[Validate]