On Tue, 18 Feb 2003 03:33:53 +0900
Brian Candler <B.Candler / pobox.com> wrote:

<snip>
> How can I make it test that the instance variable is uninitialised, so
> I can prevent a warning? This is what I am trying to do:

With "defined?" like any other variable:

>   class Foo
>     attr_reader :things
>     def add_thing(n)
<snip>
        if not defined? @things

>         @things = [] 
>       end
>       @things << n
>     end
>   end
<snip>

-- 
Ryan Pavlik <rpav / users.sf.net>

"You mean easily pawned valuable crystal orb thingie." - 8BT