Simplify ls fix from 6721f0ccd6

This commit is contained in:
Ryan Fitzgerald 2013-11-29 16:53:11 -08:00
parent 6721f0ccd6
commit e63ac30c80
1 changed files with 3 additions and 10 deletions

View File

@ -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)