Class: Debugger::VarInstanceCommand

Inherits:
Command
  • Object
show all
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 inherited from Command

commands, #find, inherited, #initialize, load_commands, #match, method_missing, options, register_setting_get, register_setting_set, register_setting_var, settings, settings_map

Constructor Details

This class inherits a constructor from Debugger::Command

Class Method Details

.help(cmd) ⇒ Object



126
127
128
129
130
# File 'lib/ruby-debug/commands/variables.rb', line 126

def help(cmd)
  %{
    v[ar] i[nstance] <object>\tshow instance variables of object. You may pass object id's hex as well.
  }
end

.help_commandObject



122
123
124
# File 'lib/ruby-debug/commands/variables.rb', line 122

def help_command
  'var'
end

Instance Method Details

#executeObject



116
117
118
119
# File 'lib/ruby-debug/commands/variables.rb', line 116

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

#regexpObject



111
112
113
114
# File 'lib/ruby-debug/commands/variables.rb', line 111

def regexp
  # id will be read as first match, name as post match
  /^\s*v(?:ar)?\s+i(?:ns(?:tance)?)?\s*(?:((?:[\\+-]0x)[\dabcdef]+)|\s|$)/
end