YARD @type for instance variables
已回答
I've searched all over the internet and can't find anything that tells me how to use the @type documentation for an instance variable.
https://www.jetbrains.com/help/ruby/using-annotations.html#local_var works just fine for local variables
I've tried both of the following and neither work
# @type @profile [Profile]
@profile = company.profiles.first
and
# @type [Profile]
@profile = company.profiles.first # Company has_many Profiles
Any help would be appreciated. Thanks!
请先登录再写评论。
Hello,
unfortunately at the moment it's supported for local variables, not instance ones. Please vote and follow the corresponding request:
https://youtrack.jetbrains.com/issue/RUBY-22276
This has now been implemented as a feature (declare just above assignment)