Closed nvoynov closed 1 year ago
Hi,
I've designed some of my classes as Data classes of Ruby 3.2 with some improvements by opening the target class like
# Function Model Func = Data.define(:name, :type, :desc, :input, :output) do # @param name [String] # @param type [String] # ... def initialize(name:, type:, desc: '', input: [], output: []) # validation skipped .. super end # Param Builder # @see Param#intiailize def self.param(name:, type:, desc: '') Param.new(name: name, type: type, desc: desc) end # Param Model inside Function Param = Data.define(:name, :type, :desc) do # @param name [String] # @param type [String] # ... def initialize(name:, type:, desc: '') # validation skipped .. super end end end
Having designed my data model that way above I just run $ yard and get constants documented under root module see picture below
$ yard
The question is ... it's actually commented as constants. But is there a way to get these constants as classes Func and Param?
The second question is how to comment properties of Func(name, type, desc, input, output) and Param(name, type, desc) in Yard
sorry for the stupid question
Hi,
I've designed some of my classes as Data classes of Ruby 3.2 with some improvements by opening the target class like
Having designed my data model that way above I just run
$ yard
and get constants documented under root module see picture belowThe question is ... it's actually commented as constants. But is there a way to get these constants as classes Func and Param?
The second question is how to comment properties of Func(name, type, desc, input, output) and Param(name, type, desc) in Yard