Re: setting local variables via eval
Robert Dober wrote:
> Obviously I miss something, but I have the feeling that this
> simplification still works, which use cases did I miss?
> ...
> puts view.render(:x => 40, :y => 2) #=> <body> 42 </body>
Try running it with the following:
puts view.render(:context => 40, :y => 2) #=> TypeError
Ara's "scope" method contains no local variables for yours to step on.
Nice trick Ara - I always appreciate your insights. I had to play with
this one a bit before properly understanding it :-)
Clifford Heath.
|