Class: Debugger::VarInstanceCommand

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

Overview

:nodoc:

Constant Summary

Constants inherited from Command

Command::DEF_OPTIONS

Class Method Summary collapse

Instance Method Summary collapse

Methods included from VarFunctions

#var_consts, #var_list, #var_locals

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



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

def help(cmd)
  %{
    v[ar] i[nstance] <object>\tshow instance variables of object
  }
end

.help_commandObject



91
92
93
# File 'lib/ruby-debug/commands/variables.rb', line 91

def help_command
  'var'
end

Instance Method Details

#executeObject



85
86
87
88
# File 'lib/ruby-debug/commands/variables.rb', line 85

def execute
  obj = debug_eval(@match.post_match)
  var_list(obj.instance_variables, obj.instance_eval{binding()})
end

#regexpObject



81
82
83
# File 'lib/ruby-debug/commands/variables.rb', line 81

def regexp
  /^\s*v(?:ar)?\s+i(?:nstance)?\s+/
end