How to document generated classes in Yard?

I have a class that I create from a factory function as follows:

Cake = MyProject.Struct(:type, :price) 

In the yard, it just displays along with my constants:

  Cake =

         Struct (: type,: price) 

I want him to appear in the list of "Classes:". After reading the documents, I was convinced that this would work:

 # @!parse class Cake; end Cake = MyProject.Struct(:type, :price) 

But that literally hasn’t changed anything.

Is it possible for Yard to document dynamically created classes as classes?

+7
ruby rdoc yard
source share
1 answer

It has been quite a while since this was asked, but although I myself went in search of an answer, I was here and decided to send my decision in case anyone else stumbles here.

I found this solved this:

 class Cake < Struct.new(:type, :cake) end 
0
source share

All Articles