ruby - Hiding a method from YARD (the right way) -


i using yard document 1 of ruby projects. have methods not want included in documentation, things #inspect , #to_s expect exist , return reasonable result.

it possible hide these methods using @private tag , yardoc --no-private command-line option:

# @private let's not document def inspect; ...; end 

however, yard documentation on @private explicitly states:

note: method not recommended hiding undocumented or “unimportant” methods. tag should used mark objects private when ruby visibility rules cannot so.

if use @api private instead, yard (nicely) tags methods badge in documentation, still shows them.

is there "legal" way hide methods yard output?

from limited tests, noticed following works (and doesn't have explicit note in documentation avoid use case):

# @!visibility private def inspect; ...; end 

according yard documentation:

@!visibility public | protected | private

modifies current parsing visibility (public, protected, or private).

hope helps.


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -