From: "R. Mark Volkmann" Date: 2005-06-20T20:08:18+09:00 Subject: Re: preventing instantiation Quoting Gavri Fernandez : > On 6/19/05, R. Mark Volkmann wrote: > > What is the recommended way in Ruby to prevent other classes from creating > > instances of a given class? The class isn't a singleton. It creates > several > > instances of itself and no additional instances should be able to be > created. > > > > I considered making the new method private, but thought there might be a > better > > way. > > What could be a better way than making new private? :) > The simplest solution is the best! I thought I knew how to do this, but maybe not. These doesn't work. private :new private :MyClass.new -- R. Mark Volkmann Partner, Object Computing, Inc.