Register Iteration Yardoc `@ macro`

I am looking for a way to iterate over registers of binary code @macro. I know that you can use them in the following form:

class Post
  include DataMapper::Resource

  # @macro dm.property
  # @return [$2] the $1 $0 of the post
  property :title, String
end

and you can generate arguments that represent registers separated by lumps, as if you were making an array section as follows:

# @macro dsl_method
# @method $1(${2--2})
# @return [${-1}] the return value of $0
create_method_with_args :foo, :a, :b, :c, String

generates: foo(a, b, c)and returns (String) the return value of create_method_with_args, but I’m interested in calling something like (${2--1}).each do |$arg|that, and in the documentation each of the parameters with one line of documentation is indicated.

0
source share
1 answer

, . - (, , , Ruby ). , . - .

, -, , - . , , , @param . (, "" , ):

# @param [String] a documentation for a
# @param [Symbol] b documentation for b
# @param [Hash] c documentation for c
create_method_with_args :bar, :a, :b, :c, Fixnum

, .

+1

All Articles