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?

Hubro
  • 56,214
  • 69
  • 228
  • 381

1 Answers1

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
ForeverZer0
  • 2,379
  • 1
  • 24
  • 32