From: Brian Candler Date: 2007-05-23T18:22:59+09:00 Subject: Re: string -> symbol, redux On Wed, May 23, 2007 at 12:05:31PM +0900, mike.cahill@comcast.net wrote: > ok... i'm still not getting it. i want the elegant way to do the last two lines in my Server initialize. and please be kind - i'm just a programming hack, not a professional. =) ... > class Server > def initialize > my_type = "fw" > extend eval("Toc44_all") > extend eval("Toc44_#{my_type}") > eval("def toc44_fw_system(args); return toc44_all_system(args);end") > eval("def toc44_fw_twoargs(*args); return toc44_all_twoargs(*args);end") > end > end Well, class Server def initialize my_type = "fw" extend Toc44_all extend Object.const_get("Toc44_#{my_type}") class <