From: Noah Easterly Date: 2007-08-13T21:50:04+09:00 Subject: Re: RDoc vs. alias_method On Aug 10, 9:14 pm, Eric Hodel wrote: > On Aug 10, 2007, at 08:16, Noah Easterly wrote: > > > Whoever uses ToothCare can just call #gargle,#rinse,or #spit - they > > don't have to worry about which implementation they're using. > > Meanwhile, I can use #dentist_gargle and #hygenist_gargle to test and > > compare. > > > This works pretty well, except when I run RDoc. It's not smart enough > > to figure out that the alias_method creates instance methods named > > #gargle,#rinse, and #spit, and so they don't get documented. > > > Is there any easy and DRY way I can tell RDoc to document those > > methods? > > Nope. The Ruby parser doesn't understand the document-method stuff > that the C parser has. > > .. So writing a patch and submitting it on the RDoc bug tracker is > the most DRY way to do that. > > -- > Poor workers blame their tools. Good workers build better tools. The > best workers get their tools to do the work for them. -- Syndicate Wars Thanks, all. As an immediate solution, I decided to make DentistToothCare and HygenistToothCare sub-classes of ToothCare, and overwrote ToothCare::new to return one or the other, depending. And if I get the time, I'll go for the longer term solution of patching RDoc, since I use dynamic aliasing and code generation often enough to make this an issue.