Making constructor private in Ruby - a la Singleton pattern

All,

I’ve been doing singletons in Java for years, but I’m having trouble
getting a similar scheme to work in Ruby.

I want to make the create() method of an ActiveRecord object private so
that it can’t be invoked by a client and the client will be forced to
use a class method to construct the object.

Here’s the method that I want to be the public class method to construct
the object:

def self.create_as_artisan()
quote_input = QuoteInput.create(:user_id => “1”, :program_id => “1”)
artisanqi = self.create()
artisanqi.quote_input = quote_input
end

I’m having trouble understanding how to make the constructor of the
object private.

I want to make it so that create_as_artisan has access to self.create()
but no one else does.

Thanks,
Wes

Here’s the method that I want to be the public class method to construct
the object:

def self.create_as_artisan()
quote_input = QuoteInput.create(:user_id => “1”, :program_id => “1”)
artisanqi = self.create()
artisanqi.quote_input = quote_input
end

I try this (these are class methods):

public
def self.create()
raise “Exception”
end

private
def self.create()
super
end

and the object is created! Why isn’t the private modifier working.

Wes