On Nov 21, 2004, at 3:05 PM, Gavin Kistner wrote:
> Summary:
> How would you store information about a class, which exposes that 
> information in an inherited manner that matches the inheritance 
> hierarchy of the class?

I forgot to add: I also need it to be able to support the 'inheritance 
hierarchy' that comes when using mixing to extend a class.

So the previous example I gave really needs to be extended (no pun 
indended) to more accurately reflect what I'm trying to do. In the 
following code excerpt, I'd like to be able to later list all methods 
described for the GavinKistner::Lutron::RadioRADimmer class, including 
those described in the Automatron::Adaptor::Electrical::Switches class 
and those described in GavinKistner::Lutron module.

require 'DescribeMethods.rb'
class Automatron::Adaptor
	self.extend( DescribeMethods )
  	self.mandatory_methods = :name, :manufacturer, :models,
		:adaptor_author, :adaptor_url, :adaptor_version, :unique_id

  	class Electrical < self
  		self.mandatory_methods = :on?, :on=, :turn_on, :turn_off, :toggle
  		class Switches < self
			describe_method :turn_on, "Turn the switch on"
			describe_method :turn_off, "Turn the switch off"
			#...
  			class Dimmers < self
  				self.mandatory_methods = :level=, :level
				describe_method :level, "Returns the brightness level of the light"
				describe_method :"level=", "Set the brightness level of the light", 
...
  			end
  		end
  	end
end

#In an author-supplied Adaptor 'plugin'
module GavinKistner
	module Lutron
		self.extend( DescribeMethods )
		def turn_on; ...; end #implementation of required method
		def turn_off; ...; end #implementation of required method
		def set_scheme( new_scheme )
			#...
		end
		describe_method :set_scheme, "Set the lighting scheme used", ...
		
		#...
		module Dimmers
			def level; ...; end
			def level=(n); ...; end
		end
		class RadioRADimmer < 
Automatron::Adaptor::Electrical::Switches::Dimmers
			include GavinKistner
			include Lutron
			include Dimmers
			def unique_id; ...; end #implementation of required method
		end
	end
end