From: 7stud -- Date: 2007-11-08T13:10:41+09:00 Subject: Re: instantiating random sub-classes (Dragon, TeethDeer, etc Thufir wrote: > On Nov 7, 7:03 pm, 7stud -- wrote: > [...] >> @@subs << new_subClass_that_was_defined >> >> end >> >> def Creature.subs #can access @@subs using: Creature.subs >> @@subs >> end >> end > [...] > > Ah, thank you for fleshing it out, but is it ok that @@subs isn't > declared? > In ruby, variables aren't declared--not even in classes. Instead, a variable springs into existence when a value is assigned to the variable. -- Posted via http://www.ruby-forum.com/.