Categories: None [Edit]

yard-heuristics

https://rubygems.org/gems/yard-heuristics
YARD-Heuristics YARD-Heuristics heuristically determines types of parameters and return values for YARD documentation that doesn’t explicitly document it. This allows you to write documentation that isn’t adorned with “obvious” types, but still get that information into the output. It also lets you nice-looking references to parameters and have them be marked up appropriately in HTML output. § Heuristics The following sections list the various heuristics that YARD-Heuristics apply for determining types of parameters and return values. Note that for all heuristics, a type will only be added if none already exists. § Parameter Named “other” A parameter named “other” has the same type as the receiver. This turns class Point def ==(other) into class Point # @param [Point] other def ==(other) § Parameter Types Derived by Parameter Name Parameters to a method with names in the following table has the type listed on the same row. | Name | Type | |--------+-----------| | index | [Integer] | | object | [Object] | | range | [Range] | | string | [String] | Thus class Point def x_inside?(range) becomes class Point # @param [Range] range def x_inside?(range) § Block Parameters If the last parameter to a method’s name begins with ‘&’ it has the type [Proc]. class Method def initialize(&block) becomes class Method # @param [Block] block def initialize(&block) § Return Types by Method Name For the return type of a method with less than two ‹@return› tags, the method name is lookup up in the following table and has the type listed on the same row. For the “type” “self or type”, if a ‹@param› tag exists with the name “other”, the type of the ...

Total

Ranking: 51,619 of 183,477
Downloads: 19,375

Daily

Ranking: 25,458 of 183,470
Downloads: 3

Depended by

RankDownloadsName
22,68659,037inventory
33,53034,417lookout
34,65832,880inventory-rake
34,98832,467inventory-rake-tasks-yard
40,74126,631value
61,84915,204lookout-rake
67,64913,372ame
77,57510,922u
99,7297,319lookout-rack

Depends on

RankDownloadsName
224160,939,746yard
22,68659,037inventory
33,53034,417lookout
34,65832,880inventory-rake
61,84915,204lookout-rake

Owners

#GravatarHandle
1iconnow