From: jd204c@... (James Davis) Date: 2002-12-10T05:57:19+09:00 Subject: Newbie: invoking class methods (Using Ruby 1.6.6) I am writing a game. A "splash" screen displays four buttons to the user. Each button has an action assigned to it, loaded from a file. When a user clicks a button, I want to execute a class method such as Game.new. First, I thought I wanted a Proc for this purpose, so I tried: ba = proc {ba} # ba = "Game.new" .... ba.call This approach didn't work. Didn't produce errors. So I switched to eval(ba) which does work, but I was hoping for a better technique. Eval seems crude and unsafe to me, particularly since the button actions are loaded from a file. I am wondering if there might be another approach such as something like "instance_method" for class methods, or send, or yield. Any advice appreciated. Thanks, - Jim Davis -