From: Haruka YAGNI Date: 2011-03-30T11:43:43+09:00 Subject: Re: Getting an Error with local variable Hi, Cheryl > if(x.respond_to?(:each)) x is not defined here. This is not x but self, isn't it? The following code works well. class String remove_method(:each) end class Object def reach if(self.respond_to?(:each)) # <<< self.each{|x| x.reach(yield)} else yield(self) end end end "hoge".reach { |myself| print myself } -- Haruka YAGNI hyagni@gmail.com