# Documenting attributes with Rdoc

**URL:** <https://www.ruby-forum.com/t/documenting-attributes-with-rdoc/69126>\
**Category:** Ruby\
**Created:** [September 18, 2006, 9:10pm UTC](https://www.ruby-forum.com/t/documenting-attributes-with-rdoc/69126 "2006-09-18T21:10:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![darren\_kirby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ed8c4c/32.png) [@darren\_kirby](https://www.ruby-forum.com/u/darren_kirby)\
**Post date:** [September 18, 2006, 9:10pm UTC](https://www.ruby-forum.com/t/documenting-attributes-with-rdoc/69126/1 "2006-09-18T21:10:51Z")

</div>

Hello all,

I have written a Lib here that parses Flac files for information, and as  
the ‘important’ stuff is written to various attributes I want to  
document  
their data structure, as some of them are quite complex and require  
explanation. I cannot figure out how to get Rdoc to work with them.

I have them all in an attr\_reader, and Rdoc finds them and puts an [R]  
next to  
them which I presume indicates they are readonly. That’s all good but  
when I  
add some documentation above the attr\_reader Rdoc adds the same text to  
all 8  
of my attributes.

I thought that I would trying creating the attributes the long way, ie:

def foo  
@foo  
end

and document them that way, but when I do this Rdoc lumps them under  
instance  
methods, which is of course technically correct but I don’t want that, I  
want  
them listed under attributes.

How can I do this? Should I just document them under the main package  
description?

thanks,  
-d

---

<div class="post-metadata">

**Author:** ![darren\_kirby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ed8c4c/32.png) [@darren\_kirby](https://www.ruby-forum.com/u/darren_kirby)\
**Post date:** [September 18, 2006, 9:16pm UTC](https://www.ruby-forum.com/t/documenting-attributes-with-rdoc/69126/2 "2006-09-18T21:16:52Z")

</div>

On Sep 18, 2006, at 2:11 PM, darren kirby wrote:

> How can I do this?

# Docs for one…

attr\_reader :one

# Docs for two…

attr\_reader :two

# Etc…

Hope that helps.

James Edward G. II

---

<div class="post-metadata">

**Author:** ![darren\_kirby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/ed8c4c/32.png) [@darren\_kirby](https://www.ruby-forum.com/u/darren_kirby)\
**Post date:** [September 18, 2006, 9:22pm UTC](https://www.ruby-forum.com/t/documenting-attributes-with-rdoc/69126/3 "2006-09-18T21:22:52Z")

</div>

quoth the James Edward G. II:

> James Edward G. II

That’s perfect!

Thanks James,  
-d
