Pedro Côrte-Real
7/25/2006 11:18:00 AM
On 7/25/06, Daniel Schierbeck <daniel.schierbeck@gmail.com> 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.