Class: Debugger::VarInheritCommand

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

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



208
209
210
211
212
# File 'lib/ruby-debug/commands/variables.rb', line 208

def help(cmd)
  %{
    v[ar] ct\t\t\tshow class heirarchy of object
  }
end

.help_commandObject



204
205
206
# File 'lib/ruby-debug/commands/variables.rb', line 204

def help_command
  'var'
end

Instance Method Details

#executeObject



189
190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/ruby-debug/commands/variables.rb', line 189

def execute
  unless @state.context
    errmsg "can't get object inheritance.\n"
    return 
  end
  puts @match.post_match
  obj = debug_eval("#{@match.post_match}.classtree")
  if obj
    print obj
  else
    errmsg "Trouble getting object #{@match.post_match}\n"
  end
end

#regexpObject



185
186
187
# File 'lib/ruby-debug/commands/variables.rb', line 185

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