Class | YARD::Tags::AttributeDirective
In: | lib/yard/tags/directives.rb
Parent: | MethodDirective

Defines an attribute with a given name, using indented block data as the attribute‘s docstring. If the type specifier is supplied with "r", "w", or "rw", the attribute is made readonly, writeonly or readwrite respectively. A readwrite attribute is the default, if no type is specified. The comment containing this directive does not need to be attached to any source, but if it is, that source code will be used as the method‘s source.

To define an regular method, see {tag:!method}

@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
      docstring text.

@example Defining a simple readonly attribute

      # @!attribute [r] count
      #   @return [Fixnum] the size of the list

@example Defining a simple readwrite attribute

      # @!attribute name
      #   @return [String] the name of the user

@see tag:!method @since 0.7.0

### Methods

after_parse method_name method_signature

### Public Instance methods

after_parse()

### Protected Instance methods

method_name()
method_signature()

[Validate]