Proper method for documenting self.new method for a class cluster factory?

5 views
Skip to first unread message

bfos...@gmail.com

unread,
May 16, 2013, 1:51:25 AM5/16/13
to yar...@googlegroups.com
Hi,

I have a factory class that implements a custom new method and I'm having trouble figuring out how to do the yard documentation for it. I'm rather new to yard, and I'm sure the answer is in the docs somewhere, but I'm just not finding it. Help?

Here's what I have so far...

# @overload new(center, start, end)
#   Create a new {Arc} given center, start and end {Point}s 
#   @option options [Point] :center (PointZero) The {Point} at the center 
#   @option options [Point] :start The {Arc} starts at the start {Point} 
#   @option options [Point] :end The {Point} where it all ends 
# @return [Arc] 
# @overload new(center, radius, start, end) 
#   Create a new {Arc} given a center {Point}, a radius and start and end angles 
#   @option options [Point] :center (PointZero) The {Point} at the center of it all 
#   @option options [Numeric] :radius Radius 
#   @option options [Numeric] :start Starting angle 
#   @option options [Numeric] :end Ending angle 
# @return [ThreePointArc] 
def self.new(options={})
    ...
end


But the resulting documentation (below) makes it look like all of the arguments are regular arguments instead of hash parameters. And, it seems to think that both overloads can return both class types, which isn't the case. I tried not listing the argument names on the @overload lines, but that didn't change anything. What am I missing?

Class Method Details

permalink+ (ArcThreePointArcnew(center, start, end)+ (ArcThreePointArcnew(center, radius, start, end)

Overloads:

Reply all
Reply to author
Forward
0 new messages