On Sun, Apr 21, 2013 at 12:56 AM, S=E9bastien 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.


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?