加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-16 20:30:53 所属栏目:百科 来源:网络整理
导读:看来很多库/插件使用这种语法: def self.included(base) # :nodoc: base.extend ClassMethods end 为什么:nodoc:part part? 解决方法 没有必要.如果应用于一个类,它只会抑制Class扩展中的所有方法的文档(rdoc).在编程Ruby中描述为: :nodoc: – Don’t i
看来很多库/插件使用这种语法:
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.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读