Class: YARD::Tags::MethodDirective
- Defined in:
- lib/yard/tags/directives.rb
Overview
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.
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 docstring text.
Defines a method object with a given method signature, using indented block data as the method’s docstring. The signature is similar to the tag:overload tag. 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 attribute method, see tag:!attribute
Direct Known Subclasses
Parser callbacks collapse
- SCOPE_MATCH =
/\A\s*self\s*\.\s*/
Instance Attribute Summary
Attributes inherited from Directive
#expanded_text, #handler, #object, #tag
Parser callbacks collapse
Methods inherited from Directive
Constructor Details
This class inherits a constructor from YARD::Tags::Directive
Instance Method Details
#after_parse ⇒ Object
373 374 375 376 377 |
# File 'lib/yard/tags/directives.rb', line 373 def after_parse return unless handler use_indented_text create_object end |
#call ⇒ Object
371 |
# File 'lib/yard/tags/directives.rb', line 371 def call; end |