On Mon, 1 Sep 2008, John Pritchard-williams wrote:
See below, what's the proper way of checking for initialized
class-variables ?
Cheers
John
--
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)
David
--
Rails training from David A. Black and Ruby Power and Light:
Intro to Ruby on Rails January 12-15 Fort Lauderdale, FL
Advancing with Rails January 19-22 Fort Lauderdale, FL *
* Co-taught with Patrick Ewing!
See http://www.rubypal.com for details and updates!