On Tue, 28 Mar 2006, Bret Pettichord wrote: > For the Watir library, we had a lot of repetitive wrapper methods with > a lot of duplicated logic. So i refactored the code. I've attached a > portion of the code below. > > This works fine, except for one thing. I can't generate rdoc for the > methods that are now created using these "macro" class methods. I've > looked at the doc for rdoc and the -A flag, but nothing really seemed > to work. > > At this point, i am thinking that the best solution would be convert > the comments into here documents, pass them as an additional argument > to the class methods and then extend the methods to write out > "prototype" methods, with comments, to a separate *.rb file that rdoc > could read (and then delete). > > Has any one else ever run into a situation like this? Any other ideas? that's a good approach. another is # # docs describing this __family__ of methods # LIST_OF_ATTRIBUTES = %w[ one two three ] LIST_OF_ATTRIBUTES.each{|m| gen_method m} which may be sufficient for you purposes. -a -- share your knowledge. it's a way to achieve immortality. - h.h. the 14th dali lama