Parent

Methods

Object

Constants

CLIPPED_PRINT

useful when playing with truly enormous objects

DEFAULT_CONTROL_D_HANDLER

Deal with the ^D key being pressed, different behaviour in different cases: 1) In an expression - behave like `!` command (clear input buffer) 2) At top-level session - behave like `exit command (break out of repl loop) 3) In a nested session - behave like `cd ..` (pop a binding)

DEFAULT_EXCEPTION_HANDLER

Will only show the first line of the backtrace

DEFAULT_EXCEPTION_WHITELIST

Don't catch these exceptions

DEFAULT_PROMPT

The default prompt; includes the target and nesting level

DEFAULT_SYSTEM
NAV_PROMPT

A prompt that includes the full object path as well as input/output (in and out) information. Good for navigation.

SHELL_PROMPT
SIMPLE_PRINT

may be convenient when working with enormous objects and pretty_print is too slow

SIMPLE_PROMPT

A simple prompt - doesn't display target or nesting level

Public Instance Methods

__binding__() click to toggle source

Return a binding object for the receiver.

# File lib/pry/core_extensions.rb, line 24
def __binding__
  if is_a?(Module)
    return class_eval "binding"
  end

  unless respond_to? :__binding_impl__
    begin
      instance_eval %{
        def __binding_impl__
          binding
        end
      }
    rescue TypeError
      self.class.class_eval %{
        def __binding_impl__
          binding
        end
      }
    end
  end

  __binding_impl__
end
pry(target=self) click to toggle source

Start a Pry REPL. This method differs from `Pry.start` in that it does not support an options hash. Also, when no parameter is provided, the Pry session will start on the implied receiver rather than on top-level (as in the case of `Pry.start`). It has two forms of invocation. In the first form no parameter should be provided and it will start a pry session on the receiver. In the second form it should be invoked without an explicit receiver and one parameter; this will start a Pry session on the parameter. @param [Object, Binding] target The receiver of the Pry session. @example First form

"dummy".pry

@example Second form

pry "dummy"

@example Start a Pry session on current self (whatever that is)

pry
# File lib/pry/core_extensions.rb, line 19
def pry(target=self)
  Pry.start(target)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.