From c7386aebc2bd2977a1234cffbb001e9a22a0b357 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Fri, 24 Jan 2014 00:24:42 -0800 Subject: [PATCH] Remove level of indirection --- lib/pry/commands/ls/ls_entity.rb | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/pry/commands/ls/ls_entity.rb b/lib/pry/commands/ls/ls_entity.rb index 7d0b4883..a8958d19 100644 --- a/lib/pry/commands/ls/ls_entity.rb +++ b/lib/pry/commands/ls/ls_entity.rb @@ -29,34 +29,32 @@ class Pry private - def greppable - proc do |entity| - entity.tap { |o| o.grep = @grep } - end + def grep(entity) + entity.tap { |o| o.grep = @grep } 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