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:
parent
3e0d76458f
commit
c7386aebc2
1 changed files with 8 additions and 10 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue