From: Robert Klemme Date: 2011-12-22T22:15:10+09:00 Subject: Re: Accessing class instance variables from an instance? On Thu, Dec 22, 2011 at 1:52 PM, Steve Klabnik wrote: >>> In my case, I ended up solving it by adding an "abar" method that just >>> called "self.class.bar", although using it that way does feel a bit silly, >>> and makes the code less readable (an observer might ask what the difference >>> between "bar" and "abar" is, for example). >> >> A better alternative would be to do this: >> >> class Object >>  def my_class; self.class end >> end > > If self.class.whatever is bothering you, the _better_ alternative is > to just drop the self. > > class Whatever >   def something_with_class >     class.something >   end > end > > rather than > > self.class.something You didn't try that, did you? This does not even compile! Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/