From: Robert Klemme Date: 2008-09-01T23:28:20+09:00 Subject: Re: Checking for 'nil' Class (not instance) variables? 2008/9/1 David A. Black : > On Mon, 1 Sep 2008, John Pritchard-williams wrote: > >> See below, what's the proper way of checking for initialized >> class-variables ? >> -- >> irb(main):031:0> @nosuchvar.nil? >> => true >> irb(main):032:0> @@nosuchvar.nil? >> NameError: uninitialized class variable @@nosuchvar in Object >> from (irb):32 >> irb(main):033:0> > > defined?(@@nosuchvar) You forgot the disclaimer that class variables are fragile and should be avoided. :-) Kind regards robert -- use.inject do |as, often| as.you_can - without end