YARD: how to create a link to a class method?
Asked Answered
P

2

12

How do you create a link to a ruby class method with YARD? Here is the yard documentation regarding links.

Linking to an instance method within the same namespace:

{#my_instance_method}

Which works fine. However, following that same approach with a class method does not compile, and modifying it:

{#self.my_class_method}

generates the following plain text (not a link):

ObjectName#self#self.my_class_method
Perdure answered 11/1, 2013 at 7:52 Comment(0)
C
12

Just use the name, bare:

{class_method}

Or if it is in a different namespace

{Object.class_method}
Canfield answered 11/1, 2013 at 11:43 Comment(0)
P
4

Use a dot.

{.class_method}

Or, if you're using markdown as a processor, you'll need to escape the underscore.

{.class\_method}
Plowman answered 11/1, 2013 at 10:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.