1
0
Fork 0
mirror of https://github.com/pry/pry.git synced 2022-11-09 12:35:05 -05:00

Remove level of indirection

This commit is contained in:
Conrad Irwin 2014-01-24 00:24:42 -08:00
parent 3e0d76458f
commit c7386aebc2

View file

@ -29,34 +29,32 @@ class Pry
private
def greppable
proc do |entity|
def grep(entity)
entity.tap { |o| o.grep = @grep }
end
end
def globals
greppable.call(Globals.new(@target, @opts))
grep(Globals.new(@target, @opts))
end
def constants
greppable.call(Constants.new(@interrogatee, @target, @no_user_opts, @opts))
grep(Constants.new(@interrogatee, @target, @no_user_opts, @opts))
end
def methods
greppable.call(Methods.new(@interrogatee, @no_user_opts, @opts))
grep(Methods.new(@interrogatee, @no_user_opts, @opts))
end
def self_methods
greppable.call(SelfMethods.new(@interrogatee, @no_user_opts, @opts))
grep(SelfMethods.new(@interrogatee, @no_user_opts, @opts))
end
def instance_vars
greppable.call(InstanceVars.new(@interrogatee, @no_user_opts, @opts))
grep(InstanceVars.new(@interrogatee, @no_user_opts, @opts))
end
def local_names
greppable.call(LocalNames.new(@target, @no_user_opts, @sticky_locals, @args))
grep(LocalNames.new(@target, @no_user_opts, @sticky_locals, @args))
end
def local_vars