O'Reilly logo
  • Rick Liu thinks this is interesting:

Proc as a Clean Room (Clean Room) to execute the code in a separate scope. (Note that the new value of $SAFE applies only inside the Proc. Contrary to what happens with other global variables, the Ruby interpreter takes care to reset $SAFE to its former value after the call.)


Cover of Metaprogramming Ruby 2