Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby 使用rdoc记录多个属性_Ruby_Rdoc - Fatal编程技术网

Ruby 使用rdoc记录多个属性

Ruby 使用rdoc记录多个属性,ruby,rdoc,Ruby,Rdoc,有没有一种方法可以记录以下每个属性,而不将它们分解为单独的声明 attr_accessor :a, :b, :c 与之相反: # description for a attr_accessor :a # description for b attr_accessor :b # description for c attr_accessor :c 那么这个呢: attr_accessor :a, :b, :c # description for a, b and c respectively

有没有一种方法可以记录以下每个属性,而不将它们分解为单独的声明

attr_accessor :a, :b, :c
与之相反:

# description for a
attr_accessor :a
# description for b
attr_accessor :b
# description for c
attr_accessor :c
那么这个呢:

attr_accessor :a, :b, :c # description for a, b and c respectively

不,您必须为每个记录的属性调用atrr_访问器

如果您希望忽略它们,则始终可以在行的末尾添加#:nodoc: