From: Robert Dober Date: 2006-06-21T07:18:58+09:00 Subject: Re: Achieve pure object oriented design in Ruby ------=_Part_64189_3085929.1150841933953 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline SNIP Fortunately I did not bet, OP does this pattern fit your needs? class A @@b = Class.new { def initialize name; @name=name; end def to_s; "#{@name}:#{self.class}"; end } class << self def factory( name ); @@b.new( name ) end end end x = A.factory( "hi" ) puts x Hope this helps Cheers Robert ------=_Part_64189_3085929.1150841933953--