[Nitro] advice.rb

Trans transfire at gmail.com
Wed Sep 5 14:20:24 EDT 2007

Ran into one snag with advice.rb. The advice blocks are not evaluated
in the instance binding of their object, so instance methods (eg. @x)
are not accessible. Unfortunately, the easy fix for this requires
#instance_exec, which (very annoyingly) isn't slated for inclusion
until Ruby 1.9.

Considering the alternatives (Proc.bind or myriads of method
definitions), it may be best to accept this limitation for the time
being. If one has to access an instance var in an advice block then
one can always make an accessor to it, which, of course, works fine.

I think, the only other thing left to do is support other methods as
advice, rather than just blocks.


More information about the Nitro-general mailing list