ruby / ruby/rdoc

Alias for attribute causes aliasing method to appear in Attributes section

Open
#1,286 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Ruby
Stars
930
Forks
465
Avg merge
3d 10h
Merged PRs (30d)
27

Description

When defining an alias for an attribute in a class, the aliasing method is incorrectly displayed in the attributes section of the generated documentation.

For example, consider the following code in lib/foo.rb:

class Foo
  attr :bar
  alias baz bar
end

When running rdoc, the documentation for the Foo class shows:

Image

This behavior is misleading, as baz is not a separate attribute but an alias method for bar method (and attribute). It would be beneficial to adjust the documentation generation to prevent alias methods from appearing in the attributes section.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the RDoc behavior described for lib/foo.rb and run rdoc on the example containing attr :bar and alias baz bar. Inspect the generated Foo documentation; done means baz no longer appears in the attributes section while bar remains documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.