微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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.

原文地址:https://www.jb51.cc/ruby/273547.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐