Debugger::Command
Implements the debugger ‘method’ command.
# File lib/ruby-debug/commands/method.rb, line 48 def execute result = if @match[1] == "iv" obj = debug_eval(@match.post_match) variables = obj.instance_variables.sort.map { |var_name| [var_name, obj.instance_variable_get(var_name)] } prv(variables, 'instance') elsif @match[1] prc("method.methods", debug_eval(@match.post_match).methods.sort) { |item, _| {name: item} } else obj = debug_eval(@match.post_match) if obj.kind_of?(Module) prc("method.methods", obj.instance_methods(false).sort) { |item, _| {name: item} } else errmsg(pr("variable.errors.not_class_module", object: @match.post_match)) && return end end print result end
Generated with the Darkfish Rdoc Generator 2.