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
quote_input = QuoteInput.create(:user_id => “1”, :program_id => “1”)
artisanqi = self.create()
artisanqi.quote_input = quote_input
I’m having trouble understanding how to make the constructor of the
I want to make it so that create_as_artisan has access to self.create()
but no one else does.