From: Ittay Dror Date: 2008-07-14T20:58:09+09:00 Subject: Re: Help with class instance variables Hi, Rick Denatale wrote: > You haven't used an class variables on this thread. Your initial code > created class instance variables, i.e. instance variables belonging to > the > object which represents the class. Class variables in Ruby use a double > @ > prefix, are visible/shared between the class, any subclasses, and > instances > of the same, have some interesting quirks in their semantics and are > avoided > or at least used sparingly by many experienced Rubyists. > > Let me rephrase, trying to to use any terminology. Let's say I have a class Person whose instances have variables like name and age. Now, the Person class also has a cache for all persons, loaded from a file. So this is a single variable shared by all instances and is initialized once. How do I initialize it in Ruby? -- Posted via http://www.ruby-forum.com/.