From: Jake McArthur Date: 2006-07-28T15:43:58+09:00 Subject: Re: Howto ? :: Person is a customer On Jul 28, 2006, at 12:39 AM, Squeak Smalltalk wrote: > Hi, > > Beginner question probably but I do not know how to do it correctly. > > I will read informations from a file and create an object. > During my load I do not know if it is a employe or a customer so I > create a person object. > After the object is created I will know which type it is. > > After I know I want to change the type of my object. > > How will you do it ? > > Best Regards > W. How about making Person#to_employee and Person#to_customer methods? That would be very Ruby-like, would it not? However, I think I would just find a way to wait until I know before instantiating it, then passing all necessary data into the appropriate .new method when I do. - Jake McArthur