From: Joel VanderWerf Date: 2005-07-12T03:05:33+09:00 Subject: Re: rdoc/attributes Patrick Gundlach wrote: > Hello out there, > > I have a lot of get/set methods that take some complex data structure. > They behave like attributes. Now I would like to use rdoc > so that these methods appear in the attributes section (just like the > ones created with attr_accessor et al.) but are not defined with > attr_accessor, because Ruby gives me lots of warnings about redefining > the method. $ rdoc -A documented_accessor=RW $ cat accessors.rb class Foo def self.documented_accessor(*args); end # Bar is very important documented_accessor :bar # Baz is crazy documented_accessor :baz def bar= (obj) #:nodoc: end def bar #:nodoc: # calculate return @complex_data_structure end def baz= (obj) #:nodoc: end def baz #:nodoc: end end And this produces exactly the output you want: > Attributes > ----------- > bar [RW] Bar is very important > baz [RW] Baz is crazy > >