How do I document generated classes in Yard?
Asked Answered
D

1

8

I have a class that I create from a factory function like this:

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

In Yard, it's simply displayed along with my constants:

Cake =

        Struct(:type, :price)

I want it to show up in the "Classes: " list. After reading up on the docs, I was lead to believe that this would work:

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

But it literally changed nothing.

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

Delphina answered 7/11, 2014 at 12:18 Comment(0)
N
1

It has been quite some time since this was asked, but while googling for an answer myself, I was lead here, and figured to post my solution in case anyone else stumbles here.

I found that this solved it:

class Cake < Struct.new(:type, :cake)
end
Nihility answered 13/3, 2018 at 21:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.