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



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

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

.help_commandObject



120
121
122
# File 'lib/ruby-debug/commands/variables.rb', line 120

def help_command
  'var'
end

Instance Method Details

#executeObject



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

def execute
  obj = debug_eval(@match.post_match.empty? ? 'self' : @match.post_match)
  var_list(obj.instance_variables, obj.instance_eval{binding()})
end

#regexpObject



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

def regexp
  /^\s*v(?:ar)?\s+ins(?:tance)?\s*/
end