class Pry::Command::SwitchTo - pry-0.10.1 Documentation

# class Pry::Command::SwitchTo

### Public Instance Methods

process(selection) click to toggle source

    # File lib/pry/commands/switch_to.rb, line 11
    def process(selection)
      selection = selection.to_i

      if selection < 0 || selection > _pry_.binding_stack.size - 1
        raise CommandError, "Invalid binding index #{selection} - use `nesting` command to view valid indices."
      else
        Pry.start(_pry_.binding_stack[selection])
      end
    end