Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

YARD: how to create a link to a class method?

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
like image 552
anxiety Avatar asked Jan 11 '13 07:01

anxiety


2 Answers

Just use the name, bare:

{class_method}

Or if it is in a different namespace

{Object.class_method}
like image 152
Andrew Haines Avatar answered Nov 01 '22 21:11

Andrew Haines


Use a dot.

{.class_method}

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

{.class\_method}
like image 24
iosctr Avatar answered Nov 01 '22 20:11

iosctr