On 22 Jul 2013, at 13:46, Francis Fish <[email protected]> wrote:
>> I (also?) thought you were trying to use this a shorthand for
>> `bus.tell(:turn_on)`, is that not what you meant?
>
> Bus is just distributing the turn_on message to its listeners? So not
> modifying self per se.
What I meant was that self would be different at A and B:
# A
with bus do
# B
tell :turn_on
end
As self is the receiver of any implicit method calls, you have to change it
within the scope of the block or `.tell` won't get called on `bus`.
As Lee said, it's evil. It's not obvious to the reader that you've changed
self, and all sorts of weird things can happen (to somebody else) down the line.
--
You received this message because you are subscribed to the Google Groups
"NWRUG" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nwrug-members.
For more options, visit https://groups.google.com/groups/opt_out.