From: "Ara.T.Howard" Date: 2005-11-17T03:22:17+09:00 Subject: Re: Metaprogramming and rdoc On Thu, 17 Nov 2005, 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. put a hook into your methods that spews out a docstring into a file. run your tests, then run rdoc over this file. take the hook out. another approach # # doccumentation # def meta_methods # empty end -a -- =============================================================================== | ara [dot] t [dot] howard [at] gmail [dot] com | all happiness comes from the desire for others to be happy. all misery | comes from the desire for oneself to be happy. | -- bodhicaryavatara ===============================================================================