From: Lyndon Samson Date: 2005-04-23T00:51:10+09:00 Subject: Re: accessor for Class Variable On 4/23/05, Robert Klemme wrote: > > > Yes, but you still don't need a class var - a standard instance var of the > class is sufficient, as you can see: > > class Op > @lookup = {} > def self.register(newOp, newOpClass) > @lookup[newOp] = newOpClass > end > end > > .... and even saves two chars typing that I could use to replace "Op" by > "self" in the method definition :-))) Ahh, lightbulbs are going off all over the place here :-) Java has nothing analogous to Class instance variables so i've be using class variables like statics. But classes are Objects, so why not treat them likewise. You can even have real singletons in Ruby, unlike Java where a singleton is unqiue to a ClassLoader. To paraphrase Alice, cooler and cooler... > > Kind regards > > robert > > -- Into RFID? www.rfidnewsupdate.com Simple, fast, news.