Class: YARD::Tags::VisibilityDirective
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Directive
|
|
Instance Chain:
self,
Directive
|
|
Inherits: |
YARD::Tags::Directive
|
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.
Parser callbacks
Class Method Summary
Instance Attribute Summary
Directive
- Inherited
#expanded_text | Set this field to replace the directive definition inside of a docstring with arbitrary text. |
#handler, #object, #tag |
Instance Method Summary
Directive
- Inherited
#after_parse | Called after parsing all directives and tags in the docstring. |
#call | Called when processing the directive. |
Constructor Details
This class inherits a constructor from YARD::Tags::Directive
Instance Method Details
#call
# File 'lib/yard/tags/directives.rb', line 611
def call if %w(public protected private).include?(tag.text) if object.is_a?(CodeObjects::Base) object.visibility = tag.text.to_sym elsif handler && !inside_directive? handler.visibility = tag.text.to_sym else parser.state.visibility = tag.text.to_sym end end end