From: Jeremy McAnally Date: 2008-02-16T07:28:56+09:00 Subject: Re: Proper way to RDoc markup? not quite I guess...? You just need to pay attention to what you're doing. :P I personally think this is more readable than inlining: # This does something fun attr_reader :fun # This does something writable attr_accessor :read_write # This does something AWESOME attr_accessor :forty_two --Jeremy On Fri, Feb 15, 2008 at 4:17 PM, Serg Koren wrote: > hm oh well. > > The difference is a matter of programming style. It makes it clear > that the comment is attached to the attribute. Also it keeps someone > from doing this > > > > # this is an X comment > a = b * c > puts b.to_s > attr_reader :x > > > ... sticking code between the comment and the object it belongs to. > > Thanks tho. > > > > > On Feb 15, 2008, at 4:06 PM, Jeremy McAnally wrote: > > > I don't think that's possible. Unless you want to hack on the RDoc > > parser, that is. > > > > What's the difference between what Jari offered and inline comments? > > > > --Jeremy > > > > On Fri, Feb 15, 2008 at 3:30 PM, Serg Koren > > wrote: > >> Not quite what i wanted. I wanted to capture inline comments. i know > >> that I can capture standalone line comments. > >> > >> Thanks though. > >> > >> On Feb 15, 2008, at 3:06 PM, Jari Williamsson wrote: > >> > >>> Serg Koren wrote: > >>>> I can't figure this out. Is there a way to inline markup an > >>>> accessor for Rdoc? > >>>> That is: > >>>> def x > >>>> attr_accessor :x # this is an X comment > >>>> attr_reader :y # this is a Y comment > >>>> end > >>>> I want the inline comments to show up in the Rdoc as part of the > >>>> attribute documentation. > >>> > >>> # this is an X comment > >>> attr_accessor :x > >>> # this is a Y comment > >>> attr_reader :y > >>> > >>> > >>> Best regards, > >>> > >>> Jari Williamsson > >>> > >> > >> > >> > > > > > > > > -- > > http://www.jeremymcanally.com/ > > > > My books: > > Ruby in Practice > > http://www.manning.com/mcanally/ > > > > My free Ruby e-book > > http://www.humblelittlerubybook.com/ > > > > My blogs: > > http://www.mrneighborly.com/ > > http://www.rubyinpractice.com/ > > > > > -- http://www.jeremymcanally.com/ My books: Ruby in Practice http://www.manning.com/mcanally/ My free Ruby e-book http://www.humblelittlerubybook.com/ My blogs: http://www.mrneighborly.com/ http://www.rubyinpractice.com/