sfcgeorge / yard-contracts

YARD Plugin for Automatic Param Docs from Contracts.
MIT License
26 stars 3 forks source link

Add method overloading support #3

Open sfcgeorge opened 9 years ago

sfcgeorge commented 9 years ago

The last overloading of a method overrides all prior ones in the docs. YARD has the @overload tag for documenting this kind of thing, and as a big feature of Contracts is dynamic dispatch, yard-contracts should support documenting it.

When a second contract is documented it should check for existing documentation of the method, add overload tag and merge. Could be tricky figuring out if the addition of overload and indent has already been done, e.g. if this isn't the first overloading of that method. Probably match(/@overload/) will do.

egonSchiele commented 9 years ago

+1 for this!