On Thu, May 5, 2011 at 3:30 PM, Stu <stu / rubyprogrammer.net> wrote:

> eval though is the root method it might be safer to use one of the
> more focused wrapper methods such as class_eval, instance_eval and
> define_method.
>
> ~Stu
>
>
It's not clear to me how those are safer, I thought those just change
contexts. For example, I can still call system (or do anything else, I would
expect).

Whatever = Class.new
users_code = 'system "echo just doin the evils"'
Whatever.class_eval users_code   # >> just doin the evils