Skip to content

What is the proper way to document a class returned from Data.define? #1553

Answered by lsegal
jcouball asked this question in Q&A
Discussion options

You must be logged in to vote

You have a few options:

The easiest way:

...But technically generates an extra runtime parsed line of Ruby.

Milestone = Data.define(:id, :summary, :status)

# Defines a project milestone
#
# @api public
#
# @!attribute [r] id
#   The unique milestone identifier (which is a URL)
#   @example
#     milestone.id #=> "https://example.com/db/btkkfcemc?a=dr&rid=197"
#   @return [String]
#
# @!attribute [r] summary
#   A short, one-line milestone summary
#
#   A summary is never blank.
#
#   @example
#     milestone.summary #=> "Doc Storage Requirements Complete"
#   @return [String]
#   @api public
#
# @!attribute [r] description
#   A possibly multi-line / multi-paragraph description of the mi…

Replies: 8 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@lwoggardner
Comment options

@lsegal
Comment options

Answer selected by lsegal
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
4 participants
Converted from issue

This discussion was converted from issue #1533 on August 26, 2024 07:37.