From e63ac30c80bec6425a0fc4a3f393e1d358714b58 Mon Sep 17 00:00:00 2001 From: Ryan Fitzgerald Date: Fri, 29 Nov 2013 16:53:11 -0800 Subject: [PATCH] Simplify ls fix from 6721f0ccd6dc7e0afb40ce54f90463490c328f96 --- lib/pry/commands/ls.rb | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/lib/pry/commands/ls.rb b/lib/pry/commands/ls.rb index 59e00d5b..ef13569a 100644 --- a/lib/pry/commands/ls.rb +++ b/lib/pry/commands/ls.rb @@ -187,20 +187,13 @@ class Pry def module_to_interrogate if interrogating_a_module? object_to_interrogate - elsif instance_of_object? - object_to_interrogate.class else - class << object_to_interrogate; self.ancestors.first; end + class << object_to_interrogate + superclass + end end end - def instance_of_object? - superclass = object_to_interrogate.instance_eval do - (class << self; self; end).superclass - end - superclass == Object - end - def write_out_globals return unless opts.present?(:globals)