Skip to content

Commit

Permalink
Add note about when to use @!attribute and @!method
Browse files Browse the repository at this point in the history
Fixes #1126
Fixes #1128
  • Loading branch information
lsegal authored Nov 4, 2017
1 parent f180935 commit c5f7a28
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/yard/tags/directives.rb
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,10 @@ def warn
#
# To define an attribute method, see {tag:!attribute}
#
# @note This directive should only be used if there is no explicit
# declaration for the method in any source files (i.e., the method
# is declared dynamically via meta-programming). In all other cases, add
# documentation to the method definition itself.
# @note For backwards compatibility support, you do not need to indent
# the method's docstring text. If a +@!method+ directive is seen with
# no indented block, the entire docstring is used as the new method's
Expand Down Expand Up @@ -431,6 +435,10 @@ def create_object
#
# To define a regular method, see {tag:!method}
#
# @note This directive should only be used if there is no explicit +attr_*+
# declaration for the attribute in any source files (i.e., the attribute
# is declared dynamically via meta-programming). In all other cases, add
# documentation to the attribute declaration itself.
# @note For backwards compatibility support, you do not need to indent
# the attribute's docstring text. If an +@!attribute+ directive is seen with
# no indented block, the entire docstring is used as the new attribute's
Expand Down

0 comments on commit c5f7a28

Please sign in to comment.