-
-
Notifications
You must be signed in to change notification settings - Fork 398
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 documentation not working as expected #1126
Comments
It is because YARD finds two attr definitions: # definition 1: with directive and return type
# @!attribute [r] client
# @return [Twitter::REST::Client]
# definition 2: naturally, and without return type
attr_reader :client The second one rewrites the first. If you'll try this: class TwitterWrapper
# @!attribute [r] client
# @return [Twitter::REST::Client]
end ...everything would be OK. |
|
Thank you for the explanation. It might be useful to have a note about this in the YARD's own YARD docs for attribute. |
It is general idea for directives (things with
|
You should not use http://www.rubydoc.info/gems/yard/file/docs/GettingStarted.md#Documenting_Attributes |
Given a class like this:
and I use YARD 0.9.9 to generate docs, I see the wrong return type:
Yet when I use just
@return
:it works fine:
I also tried
@attr [Twitter::REST::Client]
but it still showedObject
.I am using Bash on Ubuntu on Windows 10. Ruby version 2.4.2
The text was updated successfully, but these errors were encountered: