Afficher un message
Vieux 12/03/2008, 01h27   #8
Clifford Heath
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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.
  Réponse avec citation
 
Page generated in 0,06926 seconds with 9 queries