Kenichi Komiya <kom / mail1.accsnet.ne.jp> writes:

> ClassTable can be constructed from some kind of config file or
> automatically generate by some reflection feature.  Following example
> assume all classes used this way are subclass of Base.
> 
>   class Base
>     def Base.inherited(sub)
>       ClassTable[sub.name] = sub
>     end
>   end
> 
>   class Foo < Base
>     ...
>   end

Thank you. That's perfect. I wanted to avoid hard-coding class names
anywhere or using a case statement.

Jim
-- 
Jim Menard, jimm / io.com, http://www.io.com/~jimm/
"Any sufficiently complicated C or Fortran program contains an ad hoc
informally-specified bug-ridden slow implementation of half of Common Lisp."
    -- Greenspun's Tenth Rule of Programming