lib/byebug/commands/method.rb in byebug-1.0.3 vs lib/byebug/commands/method.rb in byebug-1.1.0
- old
+ new
@@ -39,10 +39,12 @@
end
end if have_methodsig
# Implements byebug's 'method' command.
class MethodCommand < Command
+ include Columnize
+
def regexp
/^\s*m(?:ethod)?\s+((iv)|(i(:?nstance)?)\s+)?/
end
def execute
@@ -51,18 +53,17 @@
obj.instance_variables.sort.each do |v|
print "%s = %s\n", v, obj.instance_variable_get(v).inspect
end
elsif @match[1]
obj = debug_eval(@match.post_match)
- print "%s\n", columnize(obj.methods.sort(),
- self.class.settings[:width])
+ print "%s\n", columnize(obj.methods.sort(), Command.settings[:width])
else
obj = debug_eval(@match.post_match)
unless obj.kind_of? Module
print "Should be Class/Module: %s\n", @match.post_match
else
print "%s\n", columnize(obj.instance_methods(false).sort(),
- self.class.settings[:width])
+ Command.settings[:width])
end
end
end
class << self