Class: Debugger::DisplayCommand

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

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, load_commands, #match, method_missing, options

Constructor Details

#initialize(state) ⇒ DisplayCommand

Returns a new instance of DisplayCommand.



39
40
41
# File 'lib/ruby-debug/commands/display.rb', line 39

def initialize(state)
  super
end

Class Method Details

.help(cmd) ⇒ Object



63
64
65
66
67
# File 'lib/ruby-debug/commands/display.rb', line 63

def help(cmd)
  %{
    disp[lay]\t\tdisplay expression list
  }
end

.help_commandObject



59
60
61
# File 'lib/ruby-debug/commands/display.rb', line 59

def help_command
  'display'
end

Instance Method Details

#executeObject



47
48
49
50
51
52
53
54
55
56
# File 'lib/ruby-debug/commands/display.rb', line 47

def execute
  n = 1
  for d in @state.display
    if d[0]
      print "%d: ", n
      display_expression(d[1])
    end
    n += 1
  end
end

#regexpObject



43
44
45
# File 'lib/ruby-debug/commands/display.rb', line 43

def regexp
  /^\s*disp(?:lay)?$/
end