在RDoC(https://github.com/ruby/rdoc)的自述文件中,提供的示例在各自的行上使用两个散列/磅符号来开始注释块.这是一种要求,还是仅仅是惯例?例如(引用自述文件):

##
# This class represents an arbitrary shape by a series of points.

class Shape

  ##
  # Creates a new shape described by a +polyline+.
  #
  # If the +polyline+ does not end at the same point it started at the
  # first pointed is copied and placed at the end of the line.
  #
  # An ArgumentError is raised if the line crosses itself, but shapes may
  # be concave.

  def initialize polyline
    # ...
  end

end

推荐答案

简单的实验表明,将双哈希减少为单哈希,甚至完全删除双哈希行,对RDoC生成文档的能力没有影响.这不是一种要求,这是作者基于个人审美做出的 Select .

Ruby相关问答推荐

MongoDB通过Brew Services";未定义的方法`plist_starting';";

有没有更好的方法来加入剩余不变的子列表?

如何在 Shopify 脚本编辑器中显示数组值?

如何在 Ruby 中验证来自多项 Select 提示的命令行输入?

如何使用 HEREDOC 作为参数传递给方法?

如何解密在 sjcl.js 中使用 ruby​​ 创建的 AES-256-GCM

在 MacOS Sierra 上使用 RMagick 2.16 的 ImageMagick 7 找不到 MagickWand.h

`expect`测试中的Rspec`eq`与`eql`

Ruby:如何计算相对于另一个路径的路径?

对具有相同键的 2 个哈希属性求和

查找两个数组之间的共同值

确定一个值是否存在于哈希数组中

rbenv、rvm 和 chruby 有什么区别?

错误数量的参数(1 代表 0)在 Ruby 中是什么意思?

Ruby - Array#<< 和 Array#push 之间的区别

为什么这个 Ruby 对象同时具有 to_s 和 inspect 似乎做同样事情的方法?

Ruby 中的 to_s 与 to_str(以及 to_i/to_a/to_h 与 to_int/to_ary/to_hash)

我可以在 OS X v10.6.8 上升级到当前版本的 Ruby (2.2.3) 吗?

解析带有标题字段的 CSV 文件作为每行的属性

在 Ruby 中创建二维数组和访问子数组