From: Emilio Tagua Date: 2007-03-20T22:55:10+09:00 Subject: Re: does Ruby not support multiple "initialize" methods for a class??? On 3/20/07, Greg Hauptmann wrote: > Hi, > > Q1 - Does Ruby not support multiple "initialize" methods for a class? > > Q2 - If no is there a reason for this out of curiosity? > > Q3 - What approach is recommended if this constraint does exist? > You could use: class Invitation attr_reader :id, :date, :user, :text, :email def Invitation.withId(id) return self.new(id) end def Invitation.withAll(id, date, user, email, text) return self.new(id, date, user, email, text) end def initialize(id = 0, date = '', user = '', email = '', text = '') super() @id = id @date = date @email = email @user = user @text = text end end then: invitation = Invitation.withId(1) or with all params.