Class Object
In: lib/pry/core_extensions.rb
Parent: Object

Methods

__binding__   pry  

Public Instance methods

Return a binding object for the receiver.

The `self` of the binding is set to the current object, and it contains no local variables.

The default definee (yugui.jp/articles/846) is set such that:

  • If `self` is a class or module, then new methods created in the binding will be defined in that class or module (as in `class Foo; end`).
  • If `self` is a normal object, then new methods created in the binding will be defined on its singleton class (as in `class << self; end`).
  • If `self` doesn‘t have a real singleton class (i.e. it is a Fixnum, Float, Symbol, nil, true, or false), then new methods will be created on the object‘s class (as in `self.class.class_eval{ }`)

Newly created constants, including classes and modules, will also be added to the default definee.

@return [Binding]

Start a Pry REPL on self.

If `self` is a Binding then that will be used to evaluate expressions; otherwise a new binding will be created.

@param [Object] object the object or binding to pry

                        (__deprecated__, use `object.pry`)

@param [Hash] hash the options hash @example With a binding

   binding.pry

@example On any object

  "dummy".pry

@example With options

  def my_method
    binding.pry :quiet => true
  end
  my_method()

@see Pry.start

[Validate]