From: Jeff Putsch Date: 2001-12-04T06:24:30+09:00 Subject: [ruby-talk:27371] Selecting class based on external information Howdy, I'm trying to select the class for an instance variable based on external information and cannot figure out how. For example: class Host # variables and routines common to all hosts, default values for # OS specific things end class SunOS < Host # overrides for OS specific things end # main routine would do this... OSname = `/bin/uname -s`.chomp myHost = OSname.new # on a Solaris system this should # be equivalent to doing "myHost = SunOS.new" The initialization of "myHost" is where I run into trouble. I can not figure out how to do this. I'm sure Ruby has some "magic" to get this done, but it's beyond me ... Jeff. -- Jeff Putsch Email: putsch@mxim.com Maxim Integrated Products Office: (503)547-2037 High Frequency CAD Engineering