gpt4 book ai didi

ruby - :method: notation supposed to do for ruby docs?到底是什么

转载 作者:数据小太阳 更新时间:2023-10-29 07:40:00 24 4
gpt4 key购买 nike

Minitest 有一堆定义如下的方法:

  ##
# :method: must_equal
# See MiniTest::Assertions#assert_equal

##
# :method: must_include
# See MiniTest::Assertions#assert_includes

##
# :method: must_match
# See MiniTest::Assertions#assert_match

##
# :method: must_output
# See MiniTest::Assertions#assert_output

这些是在 Object 模块中定义的,因此它们可用于所有对象。但为什么它们没有出现在任何文档中?我检查了 Yard 在 rdoc.info 上生成的文档,以及当我键入 gem rdoc minitest 时由 rdoc 生成的文档。他们也没有出现。如果它们没有出现在任何地方,我应该如何引用它们? :method: 应该做什么?

最佳答案

这看起来像是一种记录未明确定义的方法的方法。在某些情况下,您可能想要添加有关动态生成的方法的注释,例如,或者像此处的情况一样从另一个模块加载的方法。

关于ruby - :method: notation supposed to do for ruby docs?到底是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6066427/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com