From: Sascha Ebach Date: 2005-08-05T19:18:17+09:00 Subject: Re: Need help with with Binding.of_caller Thanks for the fast response Florian. Florian Gro� wrote: > Perhaps you can make interpolate a method on Kernel -- then you would be > able to do interpolate(@foo) and the self of the interpolate method and > the one of the caller would always be the same thus avoiding the whole > situation. Does this sound reasonable? I am not sure anymore if it is worth going through all the trouble. The whole solution is a little evally. First it is a little hard to understand, like you say yourself. Next there is the question of performance. As I understand eval is not very fast. And this is a method which is potentially being called very often. A Binding.of_caller solution would certainly be the most elegant, but faster and more reliable would be if the method would just do some stringfy thing. _i('%s whine', @color) or maybe to further simplify _i(':color_of whine', :color_of => @color) which should be easier to work with (but less flexible) for the translators. _Since I am not the author of the ri18n, he seems to be on a vacation at the moment, I have to wait and talk to him first. But I am going to suggest using the above instead of the eval magic. Unless of course some of the real wizards come up with a magical and fast solution. Chances are slim I guess. Let's see. Sascha Ebach