From: Drew Olson Date: 2008-03-06T14:15:54+09:00 Subject: Re: How to create a class in callers context?? DMisener wrote: > 1) What's the correct way to doing this? > 2) I would have thought the non-qualified class references would have > generated exceptions. > 3) What is the warning message trying to convey. Here's my crack at this, not sure this is what you're trying to do: def generate &name eval("self",name.binding).class.class_eval <<-EOS class #{name.call} def to_s name.call end end EOS end class Universe def initialize generate{:Planet} puts Universe::Planet end end generate{:Thing} Universe.new puts Thing -- Posted via http://www.ruby-forum.com/.