Download Firefox: WindowsMac OS X
logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: RDOC Question -- including parent class accessors, and linking other cl: msg#00031

Subject: Re: RDOC Question -- including parent class accessors, and linking other classes
On Saturday, November 13, 2004, 6:17:59 AM, John wrote:

> I have acouple of  quick questions regarding RDOC, but I can't seem to
> find the information anywhere in the RDOC documentation (or even with
> a Google search).

> Lets say I have a parent class like:

> class ParentClass
>   attr_reader :parent_reader
> end

> And I have a child class like:

> class ChildClass
>   attr_reader :child_reader
> end

> What would I have to do to have both "ChildClass#child_reader" _and_
> "ChildClass#parent_reader" documented in the RDOC class file for
> ChildClass? Currently, I only see "ChildClass#child_reader" in the
> docs for ChildClass, and you have to view the parent class to see the
> documentation for "ParentClass#parent_reader".

Well, they're in different classes, so it's not surprising they're
documented separately.

Did you mean

  class ChildClass < ParentClass

?  That's a recently-asked question about RDoc, and the answer is
simply "Parent methods/attributes are not documented in child
classes".  Dave Thomas, the author, is considering the matter and
would probably appreciate your input.

My "solution" to this would be a class-level comment to point out that
the class also has methods from ParentClass.  That's obviously
something you'd only do on a case by case basis.  Some parent-child
relationships are more important than others.

> Also, my generated RDOC documentation does not seem to automatically
> be creating links out of class names in the documentation. I am
> developing an application with Rails, and I have some code placed in
> the 'lib' subdirectory. In some of the documentation comments, I refer
> to the name of a model class which is stored in the 'app/models'
> subdirectory. However, the HTML documentation does not create a link
> from the class in 'lib' to the model class when I run rdoc from the
> command line above both directories. Any thoughts?

I'm sorry; I have no idea.  Sometimes I see links made successfully,
sometimes I don't, and I've never really bothered about the issue.
There might be a way to force links in RDoc (remember, it's quite
actively developed, and you should try out cutting-edge Ruby if you
can).

I'm also sorry to say this, but you're more likely to get a more
knowledgeable answer from ruby-talk.  ruby-doc is a low-volume list
with general interest but limited experience in RDoc matters.  Anyone
reading ruby-doc will also be reading ruby-talk.  Of course, you're
welcome to post to both.

Cheers,
Gavin





<Prev in Thread] Current Thread [Next in Thread>