This works in ruby 1.9.3. The #{event} is interpolated prior to the class_eval command so the string being evaluated is process.group_reset_noblock for a reset command. Should be the same reason why the def #{event} works in this case.