On Nov 12, 2007 11:10 AM,  <furtive.clown / gmail.com> 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