On Thu, Feb 26, 2009 at 10:13 PM, Chris Gardner <chris.r.gardner / gmail.com> wrote: > In metaprogramming, I know how to get the instance variable names from > an Object (through instance_variables). ¨ֲפטועקבפן חופטום זעןם > a Class? Hello Chris, before answering your question, let me ask: does #instance_variables really work the way you think it does? Consider: $: irb 01> class Foo 02> def initialize 03> @bar = 'bar' 04> end 05> def baz=(arg) 06> @baz = arg 07> end 08> end --> nil 09> Foo.new.instance_variables --> [:@bar] Why isn't @baz listed? What would you have to do before it would be listed? Ponder on that, then read over this previous thread: http://www.ruby-forum.com/topic/107601 Hope that gives you some new perspectives (and eventually, the answer to your original question!) Cheers, lasitha