From: John Wilger Date: 2004-11-24T01:50:17+09:00 Subject: adding class-methods via modules Hello, I have a module which, when a class includes the module, I would like to have it add certain class-methods to the including class. Currently, I am doing the following: module Foo def self.included(mod) mod.class_eval <<-EOF, __FILE__, __LINE__+1 def self.bar ... end EOF end end class Baz include Foo end This does accomplish the end goal---Baz::bar is a valid class method---but it has the downside that RDoc doesn't pick up the class methods defined inside Foo::included for documentation purposes. Is there either a) a way to get RDoc to pick up documentation for the ::bar method (and simply document it as Foo::bar), or b) a better way of creating these class methods on classes that include Foo that will also allow RDoc to document these methods? -- Regards, John Wilger ----------- Alice came to a fork in the road. "Which road do I take?" she asked. "Where do you want to go?" responded the Cheshire cat. "I don't know," Alice answered. "Then," said the cat, "it doesn't matter." - Lewis Carrol, Alice in Wonderland