jjzjj

ruby - 为什么需要 ":nodoc:"语法?

似乎很多库/插件都使用这种语法:defself.included(base)#:nodoc:base.extendClassMethodsend为什么:nodoc:部分是必需的? 最佳答案 没有必要。如果应用于一个类,它只会抑制类扩展中所有方法的文档(rdoc)。在ProgrammingRuby中描述为::nodoc:-Don'tincludethiselementinthedocumentation.Forclassesandmodules,themethods,aliases,constants,andattributesdir