From: Ged Byrne Date: 2003-08-22T18:36:01+09:00 Subject: Re: Class variables - a surprising result It would be good if there was a cleaner way to do this. This is code that is tackling the language rather than the problem. One of Ruby's biggest assets (for me, at least) is that idioms such as this are so rare. If this idiom could be replaced with some clear syntax I think it would be a good thing. > > > If you want to access these in instance methods, > you need to do: > > > > class Foo > > def instance_meth > > p self.class.class_eval { @var } > > end > > end > > Cool - and interesting, but if I ever saw this in > somebody's code, > well.... let's just say I'd give them a stern look. > ;) ________________________________________________________________________ Want to chat instantly with your online friends? Get the FREE Yahoo! Messenger http://uk.messenger.yahoo.com/