From: Jason Creighton Date: 2003-06-12T10:58:18+09:00 Subject: Re: Multiple Initialize methods? On Wed, 11 Jun 2003 19:36:18 +0000 (UTC) "Nick" wrote: > Hi, > > I need to create a class either with a param in the construction or nothing: > > something = Object.new > > or > > something = Object.new(val1, val2) Do it like this: class Something def initialize(xdim=defaultval, ydim=defaultvalue) # do stuff. When xdim or ydim are not given, they will be set to "defaultvalue" end end Or, you could gather the args up in an array: class Something def initialize(*args) # Do stuff. args is an array with all arguments given to the method end end Jason Creighton