Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@!attribute applies documentation to wrong class after method aliasing #626

Closed
ferrous26 opened this issue Dec 1, 2012 · 1 comment
Closed
Labels
Milestone

Comments

@ferrous26
Copy link

If I have an inner class with the same attribute as an outer class, but the inner class uses @!attribute to declare the attribute, the documentation might be applied to the outer class instead of the inner class.

I can reliably reproduce this by creating a method alias in the inner class before declaring the @!attribute information.

class A

  # Outer attr
  attr_reader :foo

  class B
    alias_method :bar?, :bar
    # @!attribute [r] foo
    #   Inner attr
  end

end
@ferrous26
Copy link
Author

Moving the method alias to after the @!attribute info works around this issue.

@lsegal lsegal closed this as completed in 756ebe7 Jan 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants