class Pry::Command::WatchExpression

Public Instance Methods

options(opt) click to toggle source
# File lib/pry/commands/watch_expression.rb, line 29
def options(opt)
  opt.on :d, :delete,
    "Delete the watch expression with the given index. If no index is given; clear all watch expressions.",
    :optional_argument => true, :as => Integer
  opt.on :l, :list,
    "Show all current watch expressions and their values.  Calling watch with no expressions or options will also show the watch expressions."
end
process() click to toggle source
# File lib/pry/commands/watch_expression.rb, line 37
def process
  case
  when opts.present?(:delete)
    delete opts[:delete]
  when opts.present?(:list) || args.empty?
    list
  else
    add_hook
    add_expression(args)
  end
end