Nested @option tags

120 views
Skip to first unread message

trevorrowe

unread,
Mar 19, 2012, 6:32:51 PM3/19/12
to YARD
Is there a mechanism for nesting @option tags? I have a number of
methods that acception an options hash. Sometimes a particular option
itself is a hash with optional keys. I'm looking for something like:

# @param [Hash] options
# @option options .... (a handful of options)
# @option options [Array<Hash>] :tags A list of tags. Each tag should
be a hash.
# @option :tags [required,String] :name Name of the tag
# @option :tags [String] :value Option tag value
# @option :tags [Boolean] :propagate (true) If the tag should
propagate when updated.

Thoughts?

weston...@gmail.com

unread,
Dec 22, 2012, 12:21:49 AM12/22/12
to yar...@googlegroups.com
I have not seen way to do this with YARD, but I would love to. 

Did you find a way to describe nested hash key/value pairs?

Weston Platter

unread,
Dec 22, 2012, 12:24:29 AM12/22/12
to yar...@googlegroups.com
Spoke too soon.
# @param [Hash] foo
#   * :key1 (String) [DefaultValue] description1
#   * :key2 (String) [DefaultValue] description2
#   * :key3 (String) [DefaultValue] description3
Reply all
Reply to author
Forward
0 new messages