From: Alan Chen Date: 2002-09-19T10:04:16+09:00 Subject: Re: Possible bug with handling of default values for a method On Thu, Sep 19, 2002 at 07:15:51AM +0900, Berge, Robert wrote: > I have the following code snippet: > > classSomeClass > def meth1( to = 'default1', msg = 'default2' ) > ... > end > end > > param1 = nil ## value is nil because of selecting from a nullable db field > param2 = "Some Message" > > sc.meth1( > param1, param2 ) If you pass nil into the first parameter, it will be nil. The defaults only get used if you dont supply any argument. sc.meth1(param1) # msg defaults to 'default2' sc.meth1 # to defaults to 'default1', msg defaults to 'default2' -- Alan Chen Digikata LLC http://digikata.com