On Apr 21, 2013 5:21 PM, "Josh Cheek" <josh.cheek / gmail.com> wrote:
>
> On Sun, Apr 21, 2013 at 12:56 AM, Sbastien Durand <lists / ruby-forum.com>
wrote:
>>
>>
>> What is the Ruby way of doing this ? Is it common to use this
>> trap method ? Thank you very much for your help (I'm new to Ruby) !
>>
>
>
> I wouldn't do that, unless I had a need to inline it (e.g. writing a
one-liner on the the command line), but I also wouldn't care enough to
change it if I saw it in my codebase. It is totally irrelevant next to
concerns about object boundaries and mutability, so it seems to me that any
disagreement is just bikeshedding.
>

The thing I don't like about using .tap in the way sown is that it feels
like a side effect, but admittedly that comes from my initial belief about
the intention of .tap. As with most things, we find new uses for things
that weren't originally thought of, and I find that good for the most part.

>
> On Sun, Apr 21, 2013 at 1:20 PM, Love U Ruby <lists / ruby-forum.com> wrote:
>>
>> Can on the same context anyone explain the difference between `tap` and
>> `inject` ?
>>
>
> Are the docs unclear?