Class: YARD::Tags::VisibilityDirective
- Inherits:
-
Directive
- Object
- Directive
- YARD::Tags::VisibilityDirective
- Defined in:
- lib/yard/tags/directives.rb
Overview
Modifies the current parsing visibility (public, protected, or private). If this directive is defined on a docstring attached to an object definition, it is applied only to that object. Otherwise, it applies the visibility to all future objects in the namespace.
Instance Attribute Summary (collapse)
-
- (String?) expanded_text
inherited
from Directive
Set this field to replace the directive definition inside of a docstring with arbitrary text.
-
- (Handlers::Base?) handler
inherited
from Directive
readonly
The handler object the docstring parser might be attached to.
-
- (CodeObjects::Base?) object
inherited
from Directive
readonly
The object the parent docstring is attached to.
-
- (DocstringParser) parser
inherited
from Directive
protected
The parser that is parsing all tag information out of the docstring.
-
- (Tag) tag
inherited
from Directive
The meta-data tag containing data input to the directive.
Parser callbacks (collapse)
Constructor Details
This class inherits a constructor from YARD::Tags::Directive
Instance Attribute Details
- (String?) expanded_text Originally defined in class Directive
Set this field to replace the directive definition inside of a docstring with arbitrary text. For instance, the MacroDirective uses this field to expand its macro data in place of the call to a @!macro.
- (Handlers::Base?) handler (readonly) Originally defined in class Directive
Returns the handler object the docstring parser might be attached to. May be nil. Only available when parsing through Parser::SourceParser.
- (CodeObjects::Base?) object (readonly) Originally defined in class Directive
Returns the object the parent docstring is attached to. May be nil.
- (DocstringParser) parser (protected) Originally defined in class Directive
Returns the parser that is parsing all tag information out of the docstring
Instance Method Details
- (Object) call
586 587 588 589 590 591 592 593 594 595 596 |
# File 'lib/yard/tags/directives.rb', line 586 def call if %w(public protected private).include?(tag.text) if object.is_a?(CodeObjects::Base) object.visibility = tag.text.to_sym elsif handler && !parser.state.inside_directive handler.visibility = tag.text.to_sym else parser.state.visibility = tag.text.to_sym end end end |