Class: Debugger::VarConstantCommand
Overview
Constant Summary
Constants inherited
from Command
Command::DEF_OPTIONS
Class Method Summary
collapse
Instance Method Summary
collapse
#var_list
Methods inherited from Command
commands, inherited, #initialize, load_commands, #match, method_missing, options
Class Method Details
.help(cmd) ⇒ Object
33
34
35
36
37
|
# File 'lib/ruby-debug/commands/variables.rb', line 33
def help(cmd)
%{
v[ar] c[onst] <object>\t\tshow constants of object
}
end
|
.help_command ⇒ Object
29
30
31
|
# File 'lib/ruby-debug/commands/variables.rb', line 29
def help_command
'var'
end
|
Instance Method Details
#execute ⇒ Object
19
20
21
22
23
24
25
26
|
# File 'lib/ruby-debug/commands/variables.rb', line 19
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_list(obj.constants, obj.module_eval{binding()})
end
end
|
#regexp ⇒ Object
15
16
17
|
# File 'lib/ruby-debug/commands/variables.rb', line 15
def regexp
/^\s*v(?:ar)?\s+c(?:onst(?:ant)?)?\s+/
end
|