From: Brian Candler Date: 2009-02-27T04:50:20+09:00 Subject: Re: Instance Variable Names Available from Class? Chris Gardner wrote: > In metaprogramming, I know how to get the instance variable names from > an Object (through instance_variables). Is there a way to get them from > a Class? A class *is* an object, with its own instance variables, and you can see them in the same way: class Foo @bar = 123 def self.flurble @bar end end p Foo.instance_variables # ["@bar"] p Foo.flurble # 123 Or did you mean something else? -- Posted via http://www.ruby-forum.com/.