From: Zach Dennis Date: 2005-11-17T02:52:25+09:00 Subject: Re: Metaprogramming and rdoc Hans Fugal wrote: > I find myself metaprogramming in ruby more and more. I think this is a > good thing. It also has the unfortunate side effect of pitting me > against my old friend rdoc. I want to document the methods, but rdoc > has no clue that they even exist. Is there some middle ground, or must > one just put it in the class's blurb, or give in to not > metaprogramming? > > A simple example: > > Class Foo > # Methods that do just about the same thing > %w{foo bar baz quux}.each do |m| > eval "def #{m}(*args); something_interesting(m.to_sym,*args); end" > end > end > > Rdoc of course knows nothing, but I may have something interesting to > say about this group of methods as a whole. My first guess(es) would be: - document the functionality in your class documentation AND/OR - use/write a code generator to generate rdoc-able ruby code with the method annotations as the method comments in the outputted ruby code, which would be picked up by rdoc Zach