Class: Debugger::VarConstantCommand
- Inherits:
-
Command
- Object
- SimpleDelegator
- Command
- Debugger::VarConstantCommand
show all
- Defined in:
- lib/ruby-debug-ide/commands/variables.rb
Overview
Constant Summary
Constants inherited
from Command
Command::DEF_OPTIONS
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Command
commands, file_filter_supported?, #find, inherited, #initialize, load_commands, #match, method_missing, options, unescape_incoming
Class Method Details
.help(cmd) ⇒ Object
23
24
25
26
27
|
# File 'lib/ruby-debug-ide/commands/variables.rb', line 23
def help(cmd)
%{
v[ar] c[onst] <object>\t\tshow constants of object
}
end
|
.help_command ⇒ Object
19
20
21
|
# File 'lib/ruby-debug-ide/commands/variables.rb', line 19
def help_command
'var'
end
|
Instance Method Details
#execute ⇒ Object
7
8
9
10
11
12
13
14
15
16
|
# File 'lib/ruby-debug-ide/commands/variables.rb', line 7
def execute
obj = debug_eval(@match.post_match)
unless obj.kind_of? Module
print_msg "Should be Class/Module: %s", @match.post_match
else
print_variables(obj.constants, "constant") do |var|
obj.const_get(var)
end
end
end
|
#regexp ⇒ Object
3
4
5
|
# File 'lib/ruby-debug-ide/commands/variables.rb', line 3
def regexp
/^\s*v(?:ar)?\s+c(?:onst(?:ant)?)?\s+/
end
|