Class: Debugger::DeleteDisplayCommand

Inherits:
Command
  • Object
show all
Includes:
DisplayFunctions
Defined in:
lib/ruby-debug/commands/display.rb

Overview

:nodoc:

Constant Summary

Constants inherited from Command

Command::DEF_OPTIONS

Class Method Summary collapse

Instance Method Summary collapse

Methods included from DisplayFunctions

#display_expression

Methods inherited from Command

commands, inherited, #initialize, load_commands, #match, method_missing, options

Constructor Details

This class inherits a constructor from Debugger::Command

Class Method Details

.help(cmd) ⇒ Object



96
97
98
99
100
# File 'lib/ruby-debug/commands/display.rb', line 96

def help(cmd)
  %{
    undisp[lay][ nnn]\tdelete one particular or all display expressions
  }
end

.help_commandObject



92
93
94
# File 'lib/ruby-debug/commands/display.rb', line 92

def help_command
  'undisplay'
end

Instance Method Details

#executeObject



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/ruby-debug/commands/display.rb', line 74

def execute
  unless pos = @match[1]
    if confirm("Clear all expressions? (y/n) ")
      for d in @state.display
        d[0] = false
      end
    end
  else
    pos = pos.to_i
    if @state.display[pos-1]
      @state.display[pos-1][0] = false
    else
      print "Display expression %d is not defined\n", pos
    end
  end
end

#regexpObject



70
71
72
# File 'lib/ruby-debug/commands/display.rb', line 70

def regexp
  /^\s*undisp(?:lay)?(?:\s+(\d+))?$/
end