Class: Debugger::MethodSigCommand
- Inherits:
-
Command
- Object
- Command
- Debugger::MethodSigCommand
show all
- Defined in:
- lib/ruby-debug/commands/method.rb
Overview
Implements the debugger ‘method sig’ command.
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
Class Method Details
.help(cmd) ⇒ Object
34
35
36
37
38
|
# File 'lib/ruby-debug/commands/method.rb', line 34
def help(cmd)
%{
m[ethod] sig[nature] <obj>\tshow the signature of a method
}
end
|
.help_command ⇒ Object
30
31
32
|
# File 'lib/ruby-debug/commands/method.rb', line 30
def help_command
'method'
end
|
Instance Method Details
#execute ⇒ Object
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/ruby-debug/commands/method.rb', line 16
def execute
obj = debug_eval('method(:%s)' % @match[1])
if obj.is_a?(Method)
begin
print "%s\n", obj.signature.to_s
rescue
errmsg("Can't get signature for '#{@match[1]}'\n")
end
else
errmsg("Can't make method out of '#{@match[1]}'\n")
end
end
|
#regexp ⇒ Object
12
13
14
|
# File 'lib/ruby-debug/commands/method.rb', line 12
def regexp
/^\s*m(?:ethod)?\s+sig(?:nature)?\s+(\S+)\s*$/
end
|