From: "Wayne E. Seguin" Date: 2007-07-08T12:06:51+09:00 Subject: Re: get modules that are in a class? --Apple-Mail-3--601619272 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed On Jul 07, 2007, at 22:47 , Aaron Smith wrote: > What about within a class? > > module TestModule > def say_something > puts "SOMETHING" > end > end > > class Test > include TestModule > end > > t = Test.new > puts t.included_modules Aaron, you can define a method within your class to expose this like so: module TestModule def say_something puts "SOMETHING" end end class Test include TestModule def modules self.class.included_modules end end t = Test.new puts t.modules If you need this exposed for all classes you can expose for the Object class: class Object def modules self.class.included_modules end end Does this help? Without knowing what you're trying to accomplish further it's difficult to come up with an optimal solution :) -- Wayne E. Seguin Sr. Systems Architect & Systems Admin wayneseguin@gmail.com --Apple-Mail-3--601619272--