Class: Debugger::VarConstantCommand

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

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



40
41
42
43
44
# File 'lib/ruby-debug/commands/variables.rb', line 40

def help(cmd)
  %{
    v[ar] c[onst] <object>\t\tshow constants of object
  }
end

.help_commandObject



36
37
38
# File 'lib/ruby-debug/commands/variables.rb', line 36

def help_command
  'var'
end

Instance Method Details

#executeObject



26
27
28
29
30
31
32
33
# File 'lib/ruby-debug/commands/variables.rb', line 26

def execute
  obj = debug_eval(@match.post_match)
  unless obj.kind_of? Module
    print "Should be Class/Module: %s\n", @match.post_match
  else
    var_consts(obj)
  end
end

#regexpObject



22
23
24
# File 'lib/ruby-debug/commands/variables.rb', line 22

def regexp
  /^\s*v(?:ar)?\s+c(?:onst(?:ant)?)?\s+/
end