Class: Docscribe::Plugin::Base::CollectorPlugin
- Inherits:
-
Object
- Object
- Docscribe::Plugin::Base::CollectorPlugin
- Defined in:
- lib/docscribe/plugin/base/collector_plugin.rb
Overview
Base class for collector plugins.
CollectorPlugins receive the raw AST and source buffer directly. They walk the tree themselves and return insertion targets that Docscribe will document according to the selected strategy.
Idempotency is handled by Docscribe:
-
:safe => skip if a doc-like block already exists above anchor_node
-
:aggressive => replace existing doc block above anchor_node
Instance Method Summary collapse
-
#collect(_ast, _buffer) ⇒ Array<Hash>
Walk the AST and return documentation insertion targets.
Instance Method Details
#collect(_ast, _buffer) ⇒ Array<Hash>
Walk the AST and return documentation insertion targets.
Each result is a Hash with:
-
:anchor_node => Parser::AST::Node — node above which to insert doc
-
:doc => String — complete doc block including newlines
49 50 51 |
# File 'lib/docscribe/plugin/base/collector_plugin.rb', line 49 def collect(_ast, _buffer) [] end |