From: Martin DeMello Date: 2007-11-13T04:31:48+09:00 Subject: Re: alias_method :tap, :affect On Nov 12, 2007 11:10 AM, wrote: > > This is the first I've heard of Object#tap. It seems backward because > you almost always want the result of the block, not the object back > again. #tap is the opposite use case - you want to "tap" the object stream, observing without affecting. It's very handy for debugging, where you can tap into a chain of method calls, print something out and continue on your way, e.g. foo.map(&:bar).tap {|a| p a}.inject... martin