From: "Pedro CĂ´rte-Real" Date: 2006-07-25T20:17:50+09:00 Subject: Re: Defining a method with an argument with a default value On 7/25/06, Daniel Schierbeck wrote: > First of all, you don't need the `if value' part -- when Ruby sees > @value, it is immediately created, with the value nil, so there's no > problem with giving it the value nil explicitly. Yes, I knew that. > Second, I believe you > can just do this: > > define_method(:initialize){|value| @value = value} > If #initialize is called with no arguments, `value' will just be nil, > although IRB may issue a warning. That's what I have but it throws a warning and I wanted to shut it up. Guess I'll have to do the eval. Thanks, Pedro.