ruby – 为什么需要“:nodoc:”语法?

看来很多库/插件使用这种语法:
def self.included(base) # :nodoc:
    base.extend ClassMethods
  end

为什么:nodoc:part part?

解决方法

没有必要.如果应用于一个类,它只会抑制Class扩展中的所有方法的文档(rdoc).在编程Ruby中描述为:

:nodoc: – Don’t include this element in the documentation. For classes and modules,the methods,aliases,constants,and attributes directly within the affected class or module will also be omitted from the documentation. By default,though,modules and classes within that class or module will be documented.

相关文章

validates:conclusion,:presence=>true,:inclusion=>{...
一、redis集群搭建redis3.0以前,提供了Sentinel工具来监控各...
分享一下我老师大神的人工智能教程。零基础!通俗易懂!风趣...
上一篇博文 ruby传参之引用类型 里边定义了一个方法名 mo...
一编程与编程语言 什么是编程语言? 能够被计算机所识别的表...
Ruby类和对象Ruby是一种完美的面向对象编程语言。面向对象编...